08.10.2010, 12:40
i am stuggling with this for some time now, i really don't know whats the prob, i have checked everything like 10 times!
Code:
format(string, sizeof(string), "INSERT INTO factory (Owner, Type, Stock, Bank, Lock, X,Y,Z, ProduceRate, Sell) VALUES('%i', '%i', '%f', '%i', '%i', '%f', '%f', '%f', '%f', '%i' )", -1, type, 10.0, 0, 0, X,Y,Z, producerate, price ); mysql_query(string); mysql_query("SELECT MAX(SQLID) FROM factory"); mysql_store_result();
Code:
[15:19:48] CMySQLHandler::Query(INSERT INTO factory (Owner, Type, Stock, Bank, Lock, X,Y,Z, ProduceRate, Sell) VALUES('-1', '4', '0.000000', '0', '0', '2809.512939', '-2393.026611', '13.628358', '800.599975', '500' )) - 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 'Lock, X,Y,Z, ProduceRate, Sell) VALUES('-1', '4', '0.000000', '0', '0', '2809.51' at line 1) [15:19:48] >> mysql_query( Connection handle: 1 ) [15:19:48] CMySQLHandler::Query(SELECT MAX(SQLID) FROM factory) - Successfully executed.