rowbvp Posted April 25, 2010 Posted April 25, 2010 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 ''84', Array'property']},'','','','','','','')' at line 1 Query was INSERT INTO home_users VALUES '84', Array'property']},'','','','','','','') Quote
ddgamedesign Posted April 25, 2010 Posted April 25, 2010 What did you change recently, before the error appeared? That might help a bit. Quote
Djkanna Posted April 25, 2010 Posted April 25, 2010 It would help if you showed us your estate but by the looks of it your array broke... Quote
DISTORTED Posted April 25, 2010 Posted April 25, 2010 I work with row on his game this is his estate.php Im not sure what it is myself can anyone help? <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); $db->query("INSERT INTO home_users VALUES('$userid',{$_GET['property']},'','','','','','','')"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=blue>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; print "[url='estate.php?sellhouse']Sell Your House[/url] "; if($ir['willmax'] > 100) { } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=2 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Image</th><th>Buy?</th></tr>"; $hq=mysql_query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC",$c); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>{$r['hWILL']}</td> <td>[img=hsepics/{$r[]</td> <td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } if ($home['home_userid'] == $userid) { $db->query("UPDATE home_users SET home_houseID = {$_GET['property']} WHERE home_userid = {$userid}"); } else { $db->query("INSERT INTO home_users VALUES '$userid', $_GET'property']},'','','','','','','')"); } } if($ir['married']) { die("You cannot manage your estate agent while your being married!"); } ?> Quote
Curt Posted April 25, 2010 Posted April 25, 2010 line 66 that query is all screwed up..lol $db->query("INSERT INTO home_users VALUES '$userid', $_GET'property']},'','','','','','','')"); should look like this $db->query("INSERT INTO home_users VALUES ('$userid', {$_GET['property']},'','','','','','','')"); hope that helps :) cheers Quote
rowbvp Posted April 25, 2010 Author Posted April 25, 2010 Thanks curt that works line 66 was the error 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.