BLiZZaRD
03-04-2006, 05:31 PM
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:
/* 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']);
}
Line 65:
if (mysql_num_rows($existingUsers) > 0)
{
require 'newuser.php';
die();
}
and line 109: (actually 105 - 109)
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);
Any help as to a fix for these? Thanks a lot!
<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>
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:
/* 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']);
}
Line 65:
if (mysql_num_rows($existingUsers) > 0)
{
require 'newuser.php';
die();
}
and line 109: (actually 105 - 109)
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);
Any help as to a fix for these? Thanks a lot!
<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>