I want to show only first 50 lines of the $name of the player using string. I used substring but its not work for me. Can anyone edit the code and show only first 50 lines of name. Thanks for the help....



             $tbl_name="players"; // Table name 

             $sql="SELECT * FROM $tbl_name ORDER BY id DESC  LIMIT 0,6";


              echo "<li><a style=\"text-decoration:none\" href=\"playerslist.php?id=" .$rows['id']. "\">" .$rows['name']. "</a></li>\n"; 

echo '<li><a style="text-decoration :none" href="playerslist.php?id='.$rows['id'].'">'.substr($rows['name'],0,50).'</a></li>';

Thanks for the reply paulkd. It shows this error Parse error: syntax error, unexpected '/' in

Hi Sabarinadh,

Did you copy and paste?
Is the error pointing to the line which I supplied?

I have tested it here and all is well.