Page 1 of 1

Showing results from query intobrowser by php script

Posted: Tue Dec 09, 2008 11:11 am
by fuzzyfuzz
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

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
 
 
 

Re: Showing results from query intobrowser by php script

Posted: Tue Dec 09, 2008 3:35 pm
by jaoudestudios
What do you get?
# echo "name: {$row['name'] }".
at first glance I see you have a mistake here (above), you must end the line with a semi colon (;) not a full stop (.)!