I am getting these errors when trying to complete the registration for the game:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/usr/public_html/folder/subfolder/mainmenu.php on line 35
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/usr/public_html/folder/subfolder/mainmenu.php on line 65
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/usr/public_html/folder/subfolder/mainmenu.php on line 109
Invalid Nick/Password
I have searched and prodded and changed everything I can think of and it only gets worse.
Here are the lines:
Line 35:
Line 65:Code:/* for each older game... */ while($tmpOldGame = mysql_fetch_array($tmpOldGames, MYSQL_ASSOC)) { /* ... clear the history... */ mysql_query("DELETE FROM history WHERE gameID = ".$tmpOldGame['gameID']); /* ... and the board... */ mysql_query("DELETE FROM pieces WHERE gameID = ".$tmpOldGame['gameID']); /* ... and the messages... */ mysql_query("DELETE FROM messages WHERE gameID = ".$tmpOldGame['gameID']); /* ... and finally the game itself from the database */ mysql_query("DELETE FROM games WHERE gameID = ".$tmpOldGame['gameID']); }
and line 109: (actually 105 - 109)Code:if (mysql_num_rows($existingUsers) > 0) { require 'newuser.php'; die(); }
Any help as to a fix for these? Thanks a lot!Code:case 'Login': /* check for a player with supplied nick and password */ $tmpQuery = "SELECT * FROM players WHERE nick = '".$_POST['txtNick']."' AND password = '".$_POST['pwdPassword']."'"; $tmpPlayers = mysql_query($tmpQuery); $tmpPlayer = mysql_fetch_array($tmpPlayers, MYSQL_ASSOC);
<EDIT> Okay, you know what, lets pretend for a moment that I am NOT stupid.. cause really I am not, although apparently I can not prove it. When you get the Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource error, it means you are not connecting to the db, right? Well knowing that, I double checked my config.php, and found the dang typo I had in there. Fixed the typo and everything is great! Sorry for being dumb, but I am going to leave this post to show other people how to solve this problem so they don't have to look dumb in public like I seem to be getting used to. *sigh* </EDIT>



Reply With Quote

Bookmarks