cohan1279 Posted July 19, 2006 Share Posted July 19, 2006 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 errorWarning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 82FATAL ERROR: Failed to update player dataIve 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(*) ..." queriesfunction sqleval ($query){ $data = mysql_fetch_row(mysql_query($query)); return $data[0];}and line 75-87// loads the information for the specified user numberfunction loadUser ($num){ global $playerdb; return mysql_fetch_array(mysql_query("SELECT * FROM $playerdb WHERE num=$num;"));}// loads the information for the specified race numberfunction 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 More sharing options...
hvle Posted July 19, 2006 Share Posted July 19, 2006 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 https://forums.phpfreaks.com/topic/14991-mysql_fetch_row-error-help/#findComment-60247 Share on other sites More sharing options...
hitman6003 Posted July 19, 2006 Share Posted July 19, 2006 Either your mysql_connect is failing, or your database is failing to connect. Seperate the query line into two statements, and add a mysql_error to the query:[code]$result = mysql_query($query) or die(mysql_error());$data = mysql_fetch_row($result);[/code] Link to comment https://forums.phpfreaks.com/topic/14991-mysql_fetch_row-error-help/#findComment-60248 Share on other sites More sharing options...
cohan1279 Posted July 19, 2006 Author Share Posted July 19, 2006 ok this is now what i haveWarning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/www/cbc1219.awardspace.com/funcs.php on line 41Table 'cohan1219_cohan.players' doesn't existok 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 https://forums.phpfreaks.com/topic/14991-mysql_fetch_row-error-help/#findComment-60271 Share on other sites More sharing options...
cohan1279 Posted July 19, 2006 Author Share Posted July 19, 2006 http://www.phpfreaks.com/forums/index.php/topic,101030.0.htmlthis is to a post with the script if if helps. any more help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/14991-mysql_fetch_row-error-help/#findComment-60285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.