hi..i am new to php.. can anyone help me.. i have problem with substr(). the thing is i want to limit the number of character to 300.. so i used substr function. but as for the syntax i need to use a string type for substring, but my intention is i need to take the value from the database and in that i need to limit the cahrcter to 300.. as it will return array i dnt knw how to proceed..
and if i use substr($des,0,300) its working fine for first 3 data base value, but not workng for rest of them.. here is my code..pls anyone help me..
<?php
include(“connection.php”);
$q=”select * from descript d,menureg m where m.menuid=d.deslink”;
$r=mysql_query($q);
$row=mysql_fetch_array($r);
while($row!=NULL)
{
$id=$row[‘descid’];
$menu=$row[‘menuname’];
$name=$row[‘title’];
$desc1=$row[‘desclink’];
$desc=$row[‘descrdata’];
$des3=strlen($desc);
$desc2=substr($desc,0,300);
?>
<td><?php echo $desc2;?></td>
<?php
$row=mysql_fetch_array($r);
}
?>
</table> </td>
i dnt knw how to proceed.. even i tried with conversio ie.by using implode() .. but its not working.. can anyone help me.. my website url is [url]www.kanoesoftwares.com