Posted by Stefan Rybacki on 11/16/05 13:59
Jonathan wrote:
> I want to be able to take a description from a database, row called
> {car_description} and cut it to a certain number of words and display
> only that for the main gallery of cars before you click to get the full
> description ... like many other sites do with the short description and
> the "more" button next to it.. I can do the mroe button but how do I
> right the rest of the tag..
>
> Assume I already have a db connection...so from inserting
> into html template engine which gets crunched by php what would I do?
> <?php xxxx.... ?>
>
Two possiblities:
1. use the database function LEFT to cut after a certain number of characters (maybe add
'...' by using CONCAT if you want
2. use for example the php function substr() to cut the retrieved string.
Regards
Stefan
Navigation:
[Reply to this message]
|