sql syntax
#1

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.
Reply


Messages In This Thread
sql syntax - by armyoftwo - 08.10.2010, 12:40
Re: sql syntax - by Relixious - 08.10.2010, 12:44
Re: sql syntax - by armyoftwo - 08.10.2010, 12:44
Re: sql syntax - by Relixious - 08.10.2010, 12:46
Re: sql syntax - by iJumbo - 08.10.2010, 12:47
Re: sql syntax - by armyoftwo - 08.10.2010, 12:49
Re: sql syntax - by iJumbo - 08.10.2010, 12:53

Forum Jump:


Users browsing this thread: 2 Guest(s)