Database communication using php,mysql
Posted: Tue Mar 10, 2009 8:48 am
$query="select * from emp where ename='$ename' and empno='$empno'";
print "<br>".$query;
$result=mysql_query($query);
print "<br>".$result."<br>";
if($result)
{
$res=mysql_fetch_array($result);
print_r($res);
while($row=$res)
{
echo "<br>".$row['ename'];
}
}
in the above code while loop executed infinite times,can any body tell the reason for that
print "<br>".$query;
$result=mysql_query($query);
print "<br>".$result."<br>";
if($result)
{
$res=mysql_fetch_array($result);
print_r($res);
while($row=$res)
{
echo "<br>".$row['ename'];
}
}
in the above code while loop executed infinite times,can any body tell the reason for that