Toddb1 Posted June 10, 2009 Share Posted June 10, 2009 ok so I got this 3rd party script (meaning I did not write it myself) I dont know enough about php to do that lol Any how I get this error on only 1 page of my script I have been able to fix most everything myself. With the exception of 1 problem which some great ppl here were able to help me get fixed now I am going to the well one more time and asking for help. the error I get is this Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fbcgoodr/public_html/SCARLITOSWAY.COM/tru/funcs.php on line 36 so when I go to the funcs.php page this is the line of code in question line 36 if (mysql_num_rows($last_sql) > 0) { for background info here is lines 33-52 { $pimp = "r".$game_id."_pimp"; $last_sql = mysql_query("select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { $last = mysql_fetch_array($last_sql); //echo "Level $game_id = $last[id]"; $sql = mysql_query("select * from medals where game_id='$game_id' and user_id='$last[id]'"); if (mysql_num_rows($sql) > 0) { while ($type=mysql_fetch_array($sql)) { //echo "Round $game_id = $type[medal]"; for($i=1;$i<=4;$i++) { //echo $i; if ($type[medal] == "level".$i."_1") { $medals[$i][1]++; } if ($type[medal] == "level".$i."_2") { $medals[$i][2]++; } if ($type[medal] == "level".$i."_3") { $medals[$i][3]++; } } } } I see this type of line several otherplace in the many different pages of code (mysql_num_rows($last_sql) > 0) so why does it not work here is there just a small mistake that I am over looking or a deeper problem I am missing can someone please help? Thanks in advance Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted June 10, 2009 Share Posted June 10, 2009 Just before that line echo out the query echo "select * from $pimp where code='$code[code]'"; make sure that $code is what it should be. This error is telling you there's something wrong with that query. Quote Link to comment Share on other sites More sharing options...
Toddb1 Posted June 10, 2009 Author Share Posted June 10, 2009 Just before that line echo out the query echo "select * from $pimp where code='$code[code]'"; make sure that $code is what it should be. This error is telling you there's something wrong with that query. just so I understand your are saying it should read $pimp = "r".$game_id."_pimp"; $last_sql = mysql_query(echo "select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { ***Update*** scratch that I tried $pimp = "r".$game_id."_pimp"; $last_sql = mysql_query(echo "select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { and $pimp = "r".$game_id."_pimp"; $last_sql = mysql_query echo ("select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { and echo $pimp = "r".$game_id."_pimp"; $last_sql = mysql_query( "select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { and none worked did I misunderstand you? Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted June 10, 2009 Share Posted June 10, 2009 no. It should read. $pimp = "r".$game_id."_pimp"; echo "select * from $pimp where code='$code[code]'"; $last_sql = mysql_query("select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { which will echo the query out to your screen. So you can see what it's actually doing. Quote Link to comment Share on other sites More sharing options...
Toddb1 Posted June 10, 2009 Author Share Posted June 10, 2009 no. It should read. $pimp = "r".$game_id."_pimp"; echo "select * from $pimp where code='$code[code]'"; $last_sql = mysql_query("select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { which will echo the query out to your screen. So you can see what it's actually doing. lol ok thanks that got it I now get the error select * from r1_pimp where code='7b5462b92828d5c9686f7fca13cfde43' Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fbcgoodr/public_html/SCARLITOSWAY.COM/tru/funcs.php on line 37 and I know that "r1" stands for "round 1" which has been cleared from the database so that is the source for the error Thanks so much for the insight you have helped me tremendously Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted June 10, 2009 Share Posted June 10, 2009 No problem. Just mark this as solved if you would. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.