|
Posted by Craig Storey on 10/24/05 20:11
phpuser32423 wrote:
> Hi all
>
> I have been searching for hours on the php website for a function that
> will allow me to display just the first 50 chars of a mysql text field
> in a results table, but i'm having no luck. I need it to create a
> results page for a site i'm creating in php. Can anyone help with this
> problem?
>
> Kind regards
>
> Marc
>
If you only need the first 50 chars for that field then you can get
MySQL to do the work for you ...
MySQL - Substring: Extracting part of a string
SELECT name, SUBSTRING(name,0,50) FROM cia WHERE region = 'Asia'
MySQL docs... http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
Craig
Navigation:
[Reply to this message]
|