You are here: Re: displaying first 50 characters of a mysql text field? « PHP Programming Language « IT news, forums, messages
Re: displaying first 50 characters of a mysql text field?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация