I have a news feature on a website and have a page that shows all of the news and a link to the actual page of each individual news. On first page that lists all the news i would like to limit the amount of Characters that is echoed from the database field. So from the code below where it states
echo $row;
that is where i need to limit the amount of characters
if you could help that would be great.
<?php
mysql_connect("","","");
mysql_select_db("");
$result = mysql_query("SELECT * FROM news ORDER BY id desc")
or die(mysql_error());
echo "<table class = feature >";
echo "<tr> <th></th> <th></th> <th></th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['Date'];
echo "</td><td>";
echo "<a href='".$row['Link']."'>".$row['Title']."</a>";
echo "</td><td>";
echo $row['News'];
echo "</td></tr>";
}
echo "</table>";
?>