I have two fields in database table, title and description. I am displaying tha data in php while loop.
My Code :
$sql = "select * from sightseeing";
$i = 1;
$res = mysql_query($sql, $conn);
if( mysql_num_rows($res) > 0) {
while($row = mysql_fetch_array($res))
{
echo "<tr>
<td>".$i++."</td>
<td>".$row["title"]."</td>
<td>".$row["description"]."</td>
</tr>";
}
}
I want to show only first 50 characters from description field. How to do that?