Jump to content

mysql_fetch_row(): error help


cohan1279

Recommended Posts

hi ive been trying to find help every where for this without any luck. i have been trying to get a program/game called promisance working but i get the following error

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 82
FATAL ERROR: Failed to update player data

Ive tryed getting help from the author but there hasnt been any supoort for a few years now. Ive also posted in mysql forum but was told it a php problem. so here i am

here is the funcs.php error lines.


line 37-43 
// evaluate an SQL query, return first cell of first row
// useful for "SELECT count(*) ..." queries
function sqleval ($query)
{
$data = mysql_fetch_row(mysql_query($query));
return $data[0];
}

and line 75-87
// loads the information for the specified user number
function loadUser ($num)
{
global $playerdb;
return mysql_fetch_array(mysql_query("SELECT * FROM $playerdb WHERE num=$num;"));
}

// loads the information for the specified race number
function loadRace ($race)
{
global $racedb;
return mysql_fetch_array(mysql_query("SELECT * FROM $racedb WHERE id=$race;"));
}


any ideas?
Link to comment
https://forums.phpfreaks.com/topic/14991-mysql_fetch_row-error-help/
Share on other sites

return mysql_fetch_array(mysql_query("SELECT * FROM $playerdb WHERE num=$num;"));
return mysql_fetch_array(mysql_query("SELECT * FROM $racedb WHERE id=$race;"));

see the WHERE id=$race, the actual value need to enclose in single quote, so change them to:

return mysql_fetch_array(mysql_query("SELECT * FROM $playerdb WHERE num='$num';"));
return mysql_fetch_array(mysql_query("SELECT * FROM $racedb WHERE id='$race'"));
ok this is now what i have

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41
Table 'cohan1219_cohan.players' doesn't exist

ok any help on how to create a table for it? sorry im a complete noob!!
thing is I thuoght that was the problem as in the install it said i needed to to create a table                "4. Create the MySQL tables:
                      $ mysql -uusername -p[password] databasename <prom.sql"
but know one would tell me what this means? just kept telling me i had a php problem.so anymore help?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.