PHP - Mysql problem

wxdqz

New Member
Hello guys & gals,

Please help me with this small mysql problem.
I had written the following code to display all the records in my table.

<?php
$link = mysql_connect("localhost");
mysql_select_db("test",$link);
$result = mysql_query("select * from mysqltest",$link);
$num = mysql_num_rows($result);
print $num;
for($i = 0;$i<$num;$i++)
{
$rrow = mysql_fetch_object($result);
print "<br>".$rrow->name." ==> ".$rrow->age;
}
mysql_close();
?>

The code gave a perfect result when I ran it in my PWS(ie.,locally).But when I uploaded this into my remote server, it gave the following error.Iused phpmyadmin to administer my database on the server.There were 3 records in the table.My remote server is Linux.

"Not a valid result source--Line 5"

Please suggest me a remedy..
regards,
vipin.
 
Back
Top