Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-13-2004, 06:19 AM   #1
Registered: Sep 2003
Location: Hull, UK
Distribution: Debian
Posts: 49

Rep: Reputation: 15
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.

Old 11-13-2004, 08:13 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Take a look at the SUBSTRING function:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make most amount of Linux users in least amount of time studpenguin General 24 02-02-2007 03:42 PM
Limiting the amount of bandwidth Apache Uses wenberg Linux - Software 0 02-07-2005 11:39 AM
Java JTextArea - limiting amount of characters entered Andy@DP Programming 3 03-10-2004 01:16 AM
Weird text printed at top of page with Open Office thordog Linux - Software 0 10-10-2002 05:05 PM
Limiting the total amount of memory usage by apache. Linux - General 8 08-30-2002 09:56 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration