Showing results from query intobrowser by php script
Posted: Tue Dec 09, 2008 11:11 am
hI!
I do not know what is wrong with this code- because i don't get the results on screen as i wrote in the code
I do not know what is wrong with this code- because i don't get the results on screen as i wrote in the code
Code: Select all
$rt=mysql_query("SELECT name FROM students");
if(!$rt)
echo "ERROR: error occured in MySQL query."; // if any error is there that will be printed to the
else
{
echo "connected successfully to query";
while ($row=mysql_fetch_array($rt))
{
echo "name: {$row['name'] }".
}
}
mysql_close($mysql_link);
?>
Need your help
Progfrog