On Fri,  7 Sep 2001 16:49, [EMAIL PROTECTED] wrote:
> Hey guys,
>
> I have a mysql database of articles, and what i'd like to do is make 1
> page that shows a brief sneak peak of each article, so what I would do
> is, show the first 50 or so words of each article and then add an
> elipses at the end. I'm sure it can be done but I wouldn't have a clue
> where to start. Any suggestions, or anyone ever done this?
>
> Thanks,
> Nate


Mysql has a substring function you could use to grab the first n 
characters, then just concatenate the elippses when you display the 
string.

With a little more effort, you could play around with substring_index to 
display the first n words of the article.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Happiness is a warm modem

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to