SQL query syntax
Posted: Thu Mar 17, 2011 1:27 pm
Can anyone see an error in my query syntax that would produce the following error?
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /mnt/.....edit_schedule.php on line 67
This is the code:
I have tried other syntax variations for the query, and get string errors, etc. The session variable echos ok.
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /mnt/.....edit_schedule.php on line 67
This is the code:
Code: Select all
$query = "SELECT * FROM `games` WHERE
`display_name`='".$_SESSION['display_name']."';";
$result = mysql_query($query, $connection);
$num=mysql_numrows($result); // <----THIS IS LINE 67
$i=0;
while ($i < $num){
$row = mysql_fetch_array($result);
// table formed below