Criminal Posted February 3, 2008 Posted February 3, 2008 Hey i have a error in v2 battle tent the file is here <?php include "globals.php"; print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge NPCs for money.[/b] <table width=100% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>"; $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); while($r=$db->fetch_row($q)) { $earn=$r['cb_money']; $v=$r['userid']; $q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q); print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> error UERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was SELECT count(*) FROM challengesbeaten WHERE npcid= Quote
John1 Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error <?php include "globals.php"; print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge NPCs for money.[/b] <table width=100% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>"; $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); while($r=$db->fetch_row($q)) { $earn=$r['cb_money']; $v=($r{'user_level'} = 0); $q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q); print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> try that Quote
Criminal Posted February 3, 2008 Author Posted February 3, 2008 Re: V2 battle tent error Thanx m8 it works Quote
HITMAN 17 Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error did u mess around with the code mate to make the error or did it come like that Quote
Criminal Posted February 3, 2008 Author Posted February 3, 2008 Re: V2 battle tent error I was editing the mod and the error come and i forget wot i did rong Quote
Cruisey Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error You need to always make back ups especially if you have no clue what your doing. preferably try to learn a bit of coding, even the basics will do to start with. You have made 3 posts so far asking for help on different subjects and if this site goes down your going to be totally screwed, so do yourself a favour (and us) and read a tutorial. :-D :mrgreen: Quote
Akash Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error Hey, I also have an error on my battletent, I haven't even edited it, but it shows only 1 NPC when I have loads. If anyone could please post a solution to this, I'd appreciate it. This is my code... <?php include "globals.php"; print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge NPCs for money.[/b] <table width=100% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>"; $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); while($r=$db->fetch_row($q)) { $earn=$r['cb_money']; $v=$r['userid']; $q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q); print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> Quote
Godhand Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error I could've sworn there was a patch for this.... Never mind I found it here try this out change $times=$db->fetch_single($q); into $times=$db->fetch_single($q2); Quote
Akash Posted February 3, 2008 Posted February 3, 2008 Re: V2 battle tent error Nope, doesn't work, Thanks for trying :-) Quote
Godhand Posted February 4, 2008 Posted February 4, 2008 Re: V2 battle tent error How many challenge bots you have? because if its like 20 change it into $times=$db->fetch_single($q20); at least it should be something similar to that. All I did was look at it from my game without pasting all of it. Quote
HITMAN 17 Posted February 5, 2008 Posted February 5, 2008 Re: V2 battle tent error i use to have the bug now i think its gone Quote
Godhand Posted February 6, 2008 Posted February 6, 2008 Re: V2 battle tent error That might be because you don't have legal codes... you messaged me a while back asking if I would code for you for some mods. Quote
seanybob Posted February 6, 2008 Posted February 6, 2008 Re: V2 battle tent error Solution: <?php include "globals.php"; print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge NPCs for money.[/b] <table width=100% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>"; $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid"); while($r=$db->fetch_row($q)) { $earn=$r['cb_money']; $v=$r['userid']; $qt=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($qt); print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> Quote
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.