PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$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
I have tried other syntax variations for the query, and get string errors, etc. The session variable echos ok.
$query = "SELECT * FROM `games` WHERE
`display_name`='".$_SESSION['display_name']."'"; //took the semikolon out after your display name var
$result = mysql_query($query, $connection);
$num=mysql_num_rows($result); // <----THIS IS LINE 67
The syntax mysql_numrows($res) is supposed to work. However I have had some cases it didn't. The proper syntax is mysql_num_rows($res);
Further check if the session display_name is set and is not only containing an empty string which as well would produse the described error.