uzairz Posted June 7, 2009 Posted June 7, 2009 QUERY 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= getting this error in Battle Tent could anyone help me Quote
Jordan Palmer Posted June 10, 2009 Posted June 10, 2009 Re: Battle Tent Error <?php include "globals.php"; if($ir['jail'] or $ir['hospital']) { echo("This page cannot be accessed while in jail or hospital."); $h->endpage(); exit; } print "<h3>Battle Tent</h3> [b]Welcome to the battle tent! Here you can challenge bot's for money.[/b] <table width='95%' cellspacing='1' class='table'><tr><th>Bot Name</th><th>Level</th><th>Times Beaten</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']; $q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$userid"); $times=$db->fetch_single($q2); print "<tr><td align='center'>{$r['username']}</td><td align='center'>{$r['level']}</td><td align='center'>$times</td><td align='center'>"; if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; } print "</td><td align='center'>{$r['cityname']}</td><td align='center'>\$".money_formatter($earn,'')."</td><td align='center'>"; if($r['npcid']) { print "[i]Already[/i]"; } else { print "[url='attack.php?ID={$r[']Challenge[/url]"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> Thats the standard, Should work for ya 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.