The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, you are asked to respect that confidentiality and not disclose, copy or make use of its contents. If received in error you are asked to destroy this email and contact the sender immediately. Your assistance is appreciated.
select left(myfield,20) from mytable;
-----Original Message-----
From: Kevin Meredith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 19 December 2002 11:03 p.m.
To: PHP
Subject: [PHP] Displaying first 20 characters of a comment


Hi.

I am trying to find out what the best way is to display only the first 20 or
so characters of a comment.  The comments which are entered separately by
users are stored in a MySql database.  I am displaying a list of the last 5
entries on the home page and then linking them to the relevant comments and
details.  However the comments are to long so I want to display only the
first portion, kind of like a intro for users to get an idea and then read
further.

I am not sure if it is best to do it with the select statement or format it
with the PHP.  Either way I am not sure how.

many thanks
Kevin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to