Showing results from query intobrowser by php script

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
fuzzyfuzz
Forum Newbie
Posts: 10
Joined: Fri Dec 05, 2008 5:07 pm

Showing results from query intobrowser by php script

Post 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
 
 
 
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Showing results from query intobrowser by php script

Post 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 (.)!
Post Reply