Dynadot โ€” .com Registration $8.99

Php/mysql error

Spaceship Spaceship
Watch

resolva

Established Member
Impact
0
Hello everyone; just posting because i have an error on my website that i cant get rid of:

What does this error mean and how can i get rid of it?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/xcs/public_html/functions/challengeforfeit.php on line 178
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Please open this page and get the code around that line, or we could not know where the problem reside. Also make sure that all tables correctly exist in database.
 
0
•••
ok here is where in the code i think it is...


//NEXT 2 FUNCTIONS DELETES AND AWARDS WINS FOR UNRESPONDED OR UNFINALIZED CHALLENGES

LINE 178 - function check_unrespondedchallenges(){




$challengeladders=mysql_query("SELECT id,respondhours,finalizehours FROM ladders WHERE challenge='1'");

while(list($id,$respondhours,$finalizehours)=mysql_fetch_row($challengeladders)){



$laterespond=date("Y-m-d H:i:s",time()-60*60*$respondhours);

$latefinalize=date("Y-m-d H:i:s",time()-60*60*$finalizehours);



$challengeinfo=mysql_query("SELECT challid,challenger,challenged,ladderid,challengerrank,challengedrank,respondedby,finalizedby FROM challenges WHERE

ladderid='$id' AND respondedby='0' AND finalizedby='0' AND challengedtime < '$laterespond' OR

ladderid='$id' AND respondedby > '0' AND finalizedby='0' AND respondedtime < '$latefinalize'");

while(list($challid,$challenger,$challenged,$ladderid,$challengerrank,$challengedrank,$respondedby,$finalizedby)=mysql_fetch_row($challengeinfo)){
 
0
•••
do you have anything in your table?
 
0
•••
I have many db tables. but i dont know what the table should be called?

What should it be called in the table/db?
 
0
•••
upload your file
and rename it to

file1.phps


and then post the url
 
0
•••
You might also want to try using mysql_error() to see if it spits out any more detailed errors.

Example:

PHP:
$challengeladders = mysql_query("SELECT id,respondhours,finalizehours FROM ladders WHERE challenge='1'") or die (mysql_error ());
:snaphappy:
 
0
•••
open, in php_my_admin, the table "ladders" in browse mode. Is there any data in there? That could be your problem. It was the same error for me, when I didn't have anything in my table! :D
 
0
•••
Still no luck, the mysql_error didnt give me anymore information

here is the link with the actually script on anyway for you to have a look at

Code

Thank You
 
0
•••
i add 8 lines
u shoud readd the lines u removed
Regards
 
0
•••
resolva said:
Still no luck, the mysql_error didnt give me anymore information

here is the link with the actually script on anyway for you to have a look at

Code

Thank You
did you check your table? I am not being funny, I had that exact same error when I was trying to read from an empty table. If there was something wrong with your syntax then the mysql error would be saying that "there is somethign wrong with your syntax". If it was a mistype then you would have a php error, and not a mysql error.
 
0
•••
sorry i change the post because for any reason
the code is changed
PHP:
	$numbers_challengeladders=array(); //line Valerie
	$numbers_challengeladders=@mysql_fetch_row($challengeladders); //line Valerie
	if (count($numbers_challengeladders)>0) { //line Valerie
challengeladders BECOMES challe ngeladders, in 2nd line, (bug vbulletin )
see the attachment file it's better
Regards
 
Last edited:
0
•••
Thanx for all your help :)

Got rid of the error, thanx again
 
0
•••
good! :) what was wrong?
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back