gurpreet Posted December 18, 2008 Share Posted December 18, 2008 i know I have recently been asking a lot of questions and I know most of the answers now, but this one is one which I have no idea about. I know it's to do with a query (duh) but I don't know which, or how to fix it. You lost to 1337 Bot. Unlucky, try again when you have trained more. and lost 9.83410511094E-5% EXP!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 'viewuser.php?u=1'>GurpZ' WHERE userid=21' at line 1 Query was UPDATE users SET hp=1,hospital=81,hospreason='Lost to GurpZ' WHERE userid=21 Attacklost.php: <?php $atkpage=1; include "globals.php"; $_GET['ID']==abs((int) $_GET['ID']); $_SESSION['attacking']=0; $_SESSION['attacklost']=0; $od=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); if($db->num_rows($od)) { $r=$db->fetch_row($od); print "You lost to {$r['username']}. Unlucky, try again when you have trained more."; $expgain=abs(($ir['level']-$r['level'])^3); $expgainp=$expgain/$ir['exp_needed']*100; $hosptime=rand(10,90); print " and lost $expgainp% EXP!"; $db->query("UPDATE users SET exp=exp-$expgain, attacking=0 WHERE userid=$userid"); $db->query("UPDATE users SET exp=0 WHERE exp<0"); $db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Lost to <a href=\'viewuser.php?u={$r['userid']}\'>{$r['username']}</a>' WHERE userid=$userid"); $db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Lost to [url='viewuser.php?u={$userid}']{$ir['username']}[/url]' WHERE userid={$r['userid']}"); event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] attacked you and lost.",$c); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'lost',unix_timestamp(),0,'$atklog');"); $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$r['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$ir['gang']}"); print " You lost 1 respect for your gang!"; } } else { print "You lost to Mr. Non-existant! =O"; } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted December 18, 2008 Share Posted December 18, 2008 Re: Attacklost Error i read someone...i though you where paying a guy to fix all your problems? Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted December 18, 2008 Share Posted December 18, 2008 Re: Attacklost Error and you have 2 querys that are the same on that page. 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.