Re: [PHP] Characters counting

2001-04-19 Thread elias
You can use MySql's LEFT() or even substring() example: SELECT substring(address,1, 20) as _addr FROM tablename and you will have to look for field "_addr" in mysql results. -elias http://www.kameelah.org/eassoft ""Jorn van Eck"" <[EMAIL PROTECTED]> wrote in message 9bkpd8$r77$[EMAIL PROTECTED

Re: [PHP] Characters counting

2001-04-18 Thread Joe Stump
look into the substr() function in PHP --Joe On Tue, Apr 18, 2000 at 09:23:39PM +0200, Jorn van Eck wrote: > Hi there, > > Does someone know how to display for example150 characters from a $ set by > MySQL? > -- > Jorn van Eck > Student Information Engineering > Almere > Tel: +31 614430902 > E-

Re: [PHP] Characters counting

2001-04-18 Thread Johannes Janson
Hi, to get the first 150 chars of a mysql filed do this: SELECT LEFT(YourField, '150') FROM YourTable WHERE YourCondition=true; This does it in MySQL and for PHP follow the mentioned substr-method. cheers Johannes ""Jorn van Eck"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 9bkpd8$r77$[EMAIL PRO

RE: [PHP] Characters counting

2001-04-18 Thread Jack Dempsey
What exactly do you need? If you have a variable that contains a string, you can do echo substr($var,0,150) to print the first 150 characters... or, are you trying to limit the amount in the mysql query? I believe you have to get the whole result then limit it in php, but others might know better