LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   PHP: limiting amount of text printed (http://www.linuxquestions.org/questions/programming-9/php-limiting-amount-of-text-printed-254293/)

jme 11-13-2004 06:19 AM

PHP: limiting amount of text printed
 
Hiya guys,

I am in the process of re-writing one of my sites in PHP using MySQL for the dynamic content. I have a table within my database that I store 'news' items that I show on a specific page within the site but I would like to show maybe the first 200 characters of the article on the front page, but I cannot work out hoiw to limit the output of the MySQL query to only 200 characters.

Any advice would be greatly appreciated.

Jamie

david_ross 11-13-2004 08:13 AM

Take a look at the SUBSTRING function:
http://dev.mysql.com/doc/mysql/en/St...s.html#IDX1334


All times are GMT -5. The time now is 06:39 PM.