[PHP-DB] Only a section from the database result

2006-07-18 Thread Benjamin Adams
I have articles in a MySQL database and I want creating a fast brows  
where people can read read the beginning of the articles and select  
the ones they want to read.


How do I only display the first say 50 chars of a 5000 char article?

$count = 1;
while(($row = mysql_fetch_array($News)) or ($count  15)){
if(isset($row['threadid'])){
echo ba href='./showpost.php?t= . $row['threadid'] . ' .  
$row['title']. /a/bbr \;
echo nbsp;nbsp;nbsp; . $row['dateline'] .  -- by:  . $row 
['postusername'] . br \;
echo nbsp;nbsp;nbsp;Views:  . $row['views'] .  - Comments:  
 . $row['replycount'] . br \br \;
echo p . $row['pagetext'] . /p; //This is the variable I  
only want the fist 50 chars

}
$count++;
}

Thanks

--Ben

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Only a section from the database result

2006-07-18 Thread Benjamin Adams

I have it working with left, Thanks everyone.

On Jul 18, 2006, at 1:57 PM, [EMAIL PROTECTED] wrote:




I have articles in a MySQL database and I want creating a fast brows
where people can read the beginning of the articles and select
the ones they want to read.

How do I only display the first say 50 chars of a 5000 char article?

$count = 1;
while(($row = mysql_fetch_array($News)) or ($count  15)){
if(isset($row['threadid'])){
echo ba href='./showpost.php?t= . $row['threadid'] . ' .
$row['title']. /a/bbr \;
echo nbsp;nbsp;nbsp; . $row['dateline'] .  -- by:  . $row
['postusername'] . br \;
echo nbsp;nbsp;nbsp;Views:  . $row['views'] .  - Comments:
 . $row['replycount'] . br \br \;
echo p . $row['pagetext'] . /p; //This is the variable I
only want the fist 50 chars
}
$count++;
}


One possible solution is to select from the database only the first 50
characters for display in the initial page: SELECT left(FieldName,  
50)

FROM tablename;

Once a user has chosen the articles they would like to read, run  
another

query and select the entire content field.

David





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] can you use php to connect to both FileMaker and MySQL simultaneously

2006-04-17 Thread Benjamin Adams

If you are using filemaker 8.0 you can connect using ODBC.

On Apr 17, 2006, at 3:17 PM, Michael Scappa wrote:

I've never done it, but assuming there is a connector for  
filemaker, there

is no reason you shouldn't be able to.

-Original Message-
From: Tami Williams [mailto:[EMAIL PROTECTED]
Sent: Monday, April 17, 2006 3:14 PM
To: php-db@lists.php.net
Subject: [PHP-DB] can you use php to connect to both FileMaker and  
MySQL

simultaneously

Thanks in advance for any help.

Can you use php to connect to both FileMaker and MySQL
simultaneously?  Has anyone ever done it?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] php5 with imap

2005-12-09 Thread Benjamin Adams

I'm trying to build and install php-5.1.1 on My Mac OS X 10.4.3
I can build it with out imap but can't get it to work when I enter it  
in:


./configure --prefix=/usr/local/php --with-apxs --enable-force-cgi- 
reidirect --enable-fast-cgi --with-openssl=/usr --with-dom=/usr/local/ 
php --with-gd --with-mysql --with-mysql-socket=/tmp/mysql.sock -- 
enable-sockets --enable-wddx --enable-xslt --with-zlib=/usr --with- 
xml --with-xmlrpc --enable-exif --enable-wddx --enable-ftp --enable- 
mbstring -enable-xslt --with-ldap --with-xml --with-xmlrpc --with- 
iodbc=/usr --enable-sockets --enable-dbx --enable-dbase --enable- 
trans-sid --with-dom=/usr/local/php --with-dom-xslt=/usr/local/php -- 
with-dom-exslt=/usr/local/php --with-xslt-sablot=/usr/local/php -- 
enable-zend-multibyte --enable-maintainer-zts --with-openssl=/usr -- 
with-jpeg-dir=/usr/local/php --with-imap-ssl=/usr --with-imap=../ 
imap-2004g


I already ran make osx in imap-2004g

When building I get:
checking whether build with IMAP works... no
configure: error: build test failed. Please check the config.log for  
details.


config.log
configure:47438: checking whether build with IMAP works
configure:47476: gcc -o conftest -DBIND_8_COMPAT=1 -DEAPI -O3  -no- 
cpp-precomp  -L/usr/local/php/lib -L/usr/local/php/lib -L/usr/local/ 
lib -L/usr/local/lib -L/Users/badams/Desktop/imap-2004g/c-client -L/ 
Users/badams/Desktop/imap-2004g/c-client conftest.c -lc-client   - 
lssl -lcrypto -lpam -lpng -lz -ljpeg -lssl -lcrypto -lz -lssl - 
lcrypto -lm  -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 15

/usr/bin/ld: Undefined symbols:
_gss_accept_sec_context
_gss_acquire_cred
_gss_delete_sec_context
_gss_display_name
_gss_display_status
_gss_import_name
_gss_init_sec_context
_gss_nt_service_name
_gss_release_buffer
_gss_release_cred
_gss_release_name
_gss_unwrap
_gss_wrap
_krb5_aname_to_localname
_krb5_free_context
_krb5_free_principal
_krb5_init_context
_krb5_kt_close
_krb5_kt_default
_krb5_kt_start_seq_get
_krb5_parse_name
collect2: ld returned 1 exit status
configure: failed program was:
#line 47449 configure
#include confdefs.h


void mm_log(void){}
void mm_dlog(void){}
void mm_flags(void){}
void mm_fatal(void){}
void mm_critical(void){}
void mm_nocritical(void){}
void mm_notify(void){}
void mm_login(void){}
void mm_diskerror(void){}
void mm_status(void){}
void mm_lsub(void){}
void mm_list(void){}
void mm_exists(void){}
void mm_searched(void){}
void mm_expunged(void){}

char mail_newbody();
int main() {
  mail_newbody();
  return 0;
}
 


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] connect vs pconnect

2005-12-08 Thread Benjamin Adams
I'm trying to figure out if running mysql_connect or mysql_pconnect  
would be faster.

Can someone explain the difference?
Picking one for a very high traffic website with a 10 G database.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Debugging

2005-12-02 Thread Benjamin Adams
Can anyone give me an ideas or ways for me to find out a problem on  
my website?
Its either the Invision power boards code, apache config or MySQL  
config.
I'm having trouble figuring out which one is causing the problems,  
can someone lead me to some good tips or programs to help me figure  
this out.

THANKS

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Debugging

2005-12-02 Thread Benjamin Adams
On think I'm looking to figure out is how much it takes for an http  
process to connect.


On Dec 2, 2005, at 3:17 PM, Benjamin Adams wrote:

Can anyone give me an ideas or ways for me to find out a problem on  
my website?
Its either the Invision power boards code, apache config or MySQL  
config.
I'm having trouble figuring out which one is causing the problems,  
can someone lead me to some good tips or programs to help me figure  
this out.

THANKS

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php