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
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'"));
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.