SA-MP Forums Archive
An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... (/showthread.php?tid=377554)



An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... - rati555 - 14.09.2012

pawn Code:
format(Query, sizeof(Query), "INSERT INTO `houses` (`hID`, `Owned`, `Owner`, `Discription`, `EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `Level`, `Value`, `Healthx`, `Armourx`, `Hel`, `Arm`,`Int`,`Lock`,`Rooms`,`Rent`,`Rentabil`,`Takings) VALUES (%d, 0, 'The State', %s,%f,%f,%f,%f,%f,%f,%d,%d,0,0,0,0,%d,1,0,0,0,0)",
hid,Description,EntX,EntY,EntZ,ExitX,ExitY,ExitZ,Level,Value,Int);
mysql_query(Query);
Mysql Error
Code:
[23:47:41] CMySQLHandler::Query(INSERT INTO `houses` (`hID`, `Owned`, `Owner`, `Discription`, `EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `Level`, `Value`, `Healthx`, `Armourx`, `Hel`, `Arm`,`Int`,`Lock`,`Rooms`,`Rent`,`Rentabil`,`Takings) VALUES (2, 0, 'The State', Patara Saxli,1532.328247,-1694.320800,13.382812,225.756988,1240.000000,1082.149902,4,50000,0,0,0,0,2,1,0,0,0,0)) - An error has occured. (Error ID: 1064, 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)



Re: An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... - Kirollos - 14.09.2012

you forgot some quotes in it

Code:
format(Query, sizeof(Query), "INSERT INTO `houses` (`hID`, `Owned`, `Owner`, `Discription`, `EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `Level`, `Value`, `Healthx`, `Armourx`, `Hel`, `Arm`,`Int`,`Lock`,`Rooms`,`Rent`,`Rentabil`,`Takings`) VALUES (%d, 0, 'The State', `%s`,%f,%f,%f,%f,%f,%f,%d,%d,0,0,0,0,%d,1,0,0,0,0)",
hid,Description,EntX,EntY,EntZ,ExitX,ExitY,ExitZ,Level,Value,Int);
mysql_query(Query);
NOTE: Mistakes are marked in bold

NOTE2: i guess you made a typo in the query in INSERT INTO (at Discription , it should be Description )