<?php
$dbConnection = mysql_connect('localhost', 'root', NULL);
mysql_select_db('aa', $dbConnection);
$resource = mysql_query('SELECT * FROM qlist ORDER BY part ASC', $dbConnection);
$rows = mysql_num_rows($resource);
$result = NULL;
for ($i=0; $i<$rows; $i++) {
$row = mysql_fetch_object($resource);
$result = $row->name;
$result = $row->email;
$result = $row->password;
$result = $row->country;
}
print $result;
?>
I get this:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\www\login\show.php on line 12
What's wrong? I got this same piece of code with $result etc. working in another script, but seems not to work here.