I am able to load data off my database into my webpage. However, there are a couple of instances where I would like to limit the number of characters that are placed on a row.
For example, “DESCRIPTION” is a varchar(200), and I only want to show the first 30 characters on this particular page.
<td><?php print $row->DESCRIPTION; ?></td>
What is the best way to go about doing this?
Thanks.
Ended up using this,
<td><?php print substr($row->DESCRIPTION,0,20); ?></td>
I would do it on the php side with
substr.Of course that doesnt take into account words and what not so you might need to get more complex with that by writing a custom function if thats important.