Cancelled

Simple PHP Code Fix

Hi there,

My website is coming up with this error:

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 ''fs')' at line 1

Query was INSERT INTO surrenders VALUES('',0,28,,'fs')

It uses this Piece of PHP I think, willing to pay for fix thanks:

{

$_POST['war'] = abs((int) $_POST['war']);

$wq=$db->query("SELECT * FROM gangwars where warID={$_POST['war']}");

$r=$db->fetch_row($wq);

if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; }

$db->query("INSERT INTO surrenders VALUES('',{$_POST['war']},{$ir['gang']},".$r[$f].",'{$_POST['msg']}')");

$ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]);

$them=$db->fetch_row($ggq);

$event=str_replace("'","''","<a href='[url removed, login to view];ID={$ir['gang']}'>{$gangdata['gangNAME']}</a> have asked to surrender the war against <a href='[url removed, login to view];ID={$them['gangID']}'>{$them['gangNAME']}</a>");

$db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')");

print "You have asked to surrender.";

}

Skills: PHP

See more: php manual, id to code, code your, code war, code line, sql r, sql in r, server code, r sql, Sql code, simple query, print manual, php w, PHP simple, php code, msg, IR, int, gang, fix w

About the Employer:
( 115 reviews ) Newark, United Kingdom

Project ID: #496582

56 freelancers are bidding on average $32 for this job

sanjay2004

We are ready to fix [login to view URL] [login to view URL]

$75 USD in 1 day
(490 Reviews)
9.4
lightcresent

Get it fixed now... Thx

$50 USD in 0 days
(480 Reviews)
9.0
cheapestandbest

Ready to fix.

$75 USD in 1 day
(579 Reviews)
8.7
revolutes

Ready to fix immediately. thanks

$45 USD in 1 day
(186 Reviews)
8.6
VALUEONWEB

I will do this now

$30 USD in 0 days
(211 Reviews)
7.9
Arenabpo

Hello, I am php expert, i can help you fix this. thanks!

$30 USD in 0 days
(154 Reviews)
7.7
sureshdevi

I can do this work. Thanks, Suresh

$30 USD in 1 day
(707 Reviews)
7.5
BestWeb4U

I'm expert PHP. let me do it now

$30 USD in 0 days
(161 Reviews)
7.5
NickolaS

Hi, please, check your PM

$30 USD in 0 days
(329 Reviews)
7.5
TakeReal

I can fix. I need FTP access.

$30 USD in 1 day
(1254 Reviews)
7.5
jexplorer

Please check PMB.. jexplorer

$30 USD in 0 days
(167 Reviews)
7.3
AStonetech

Please check PMB for solution of his code.

$30 USD in 0 days
(137 Reviews)
6.5
serge4dev

Hello. I can fix it right now.

$30 USD in 1 day
(104 Reviews)
6.2
mharvinhl

Hi, Please see PMB Thanks

$30 USD in 0 days
(100 Reviews)
6.2
anode

Ready to fix this right now. Thank you.

$30 USD in 1 day
(106 Reviews)
6.1
stdhtelkom

see pm, please. thanks.

$30 USD in 1 day
(25 Reviews)
6.0
wincent

pretty easy & quick work, ready to start.

$30 USD in 0 days
(79 Reviews)
6.0
utpal4job

Ready to do this right away. Thanks.

$30 USD in 0 days
(64 Reviews)
5.9
exitsol

Lets get started

$30 USD in 0 days
(107 Reviews)
5.8
erwindraft

This should be really easy, can fixed it now and fast...

$30 USD in 0 days
(89 Reviews)
5.8