Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 05-14-2007, 10:41 AM
Junior Member
 
Join Date: 04-30-07
Posts: 15
iTrader: 0 / 0%
Exclamation Help please

I got this error on the script...

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sweethon/public_html/batchgame/index.php on line 89

The page comes up and everything... BUT this error worries me.. also I've been getting this error on other scripts not just this one.. so generl advice would be nice also.. any advice would be nice lol!. I tried a few things with it but nothing seemed to work so i gave up.. thanks
HERES LINE 79 TO 92

</tr>
<tr align="center" bgcolor="#666666">
<td><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Batch</font></td>
<td><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">E-Gold</font></td>
<td><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Bet</font></td>
<td><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Win</font></td>
</tr>
<?
$res = mysql_query("select * from batch where gameid='$_id' order by id desc");
if (mysql_num_rows($res)>0) {
$ctr = 0;
while ($row=mysql_fetch_array($res)) {
$ctr = $ctr+1;
?>
 
Reply With Quote
  #2 (permalink)  
Old 05-15-2007, 02:04 PM
StupidScript's Avatar
Senior Member
Latest Blog:
None

 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
Code:
$res = mysql_query("select * from batch where gameid='$_id' order by id desc"); if (mysql_num_rows($res)>0) {
The error you are receiving tells you that the 'resource' (mysql handler: $res) does not contain a valid array. In this case, the query didn't run properly. To troubleshoot, replace your query line with this one:
Code:
$res = mysql_query("select * from batch where gameid='$_id' order by id desc") or die ("No query: ".mysql_error());
You should now get an error explaining what happened with the query. Fix that, and your result resource should be valid.
__________________
James Butler

Where would we be without rhetorical questions?
 
Reply With Quote
  #3 (permalink)  
Old 05-15-2007, 02:09 PM
Junior Member
 
Join Date: 04-30-07
Posts: 15
iTrader: 0 / 0%
Thank you.. i think i can fix it now!
 
Reply With Quote
  #4 (permalink)  
Old 05-24-2007, 11:54 PM
Contributing Member
Latest Blog:
None

 
Join Date: 05-06-07
Posts: 84
iTrader: 0 / 0%
Please, post new MySQL error if you have one
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:01 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.