Forum Moderators: coopster
$sql = "select * from tbltest";
echo "SQL: " .$sql ."<Br>";
$result = mysql_query($sql);
$totalRecords = mysql_num_rows($result); // <-- This is line 9
echo "<br>Total records: " .$totalRecords;
?>
=============================
and it works well on my localhost and some other free host.
But now i've just bought a hosting package and have the following result when i browse to dbcon_test.php.
======================
SQL: select * from tbltest
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/abc/public_html/dbcon_test.php on line 9
Total records:
================================
It seems to be no record in my database, but acctually when i try the same query in the phpMyAdmin of THAT HOST. It's still run well and show me the result of that query.
Somebody help me.
Thank you.
The reason sounds strange and silly but it was like this:
I've written an email and send to my hosting provider to tell them about my problem and ask they check my hosting configuration.
After all, they sent me an email and said that they have a problem with their mysql server but it's ok now. I check my website again and it works, great isn't it :o)
But now i'm thinking about their answer. If they have a problem with their mysql server, so why i still can do the queries in their phpMyAdmin, which still return the right results!?!?!
Strange!