SA-MP Forums Archive
mysql query error - 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: mysql query error (/showthread.php?tid=471712)



mysql query error - BlackRaven - 24.10.2013

Im trying to do this query but it wont work let me show you.
pawn Код:
format(query, sizeof(query),"INSERT INTO bizinfo (bid, benterx, bentery, benterz, bexitx, bexity, bexitz, binterior, bvalue, bname) VALUES (NULL,'%f','%f','%f','%f','%f','%f','%d','%d','%s'",
    pPOS[0],pPOS[1],pPOS[2], interiors[bint][posx],interiors[bint][posy],interiors[bint][posz],interiors[bint][hint],bprice,bbname);
    mysql_query(query);
The error is this one
Quote:

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: mysql query error - rickisme - 24.10.2013

You forgot ")"

pawn Код:
format(query, sizeof(query),"INSERT INTO bizinfo (bid, benterx, bentery, benterz, bexitx, bexity, bexitz, binterior, bvalue, bname) VALUES (NULL,'%f','%f','%f','%f','%f','%f','%d','%d','%s')",
    pPOS[0],pPOS[1],pPOS[2], interiors[bint][posx],interiors[bint][posy],interiors[bint][posz],interiors[bint][hint],bprice,bbname);
    mysql_query(query);



Re: mysql query error - BlackRaven - 24.10.2013

Worked just fine thanks mate. Just one thing where did I miss the ")"?


Re: mysql query error - rickisme - 24.10.2013

Here :

Код:
format(query, sizeof(query),"INSERT INTO bizinfo (bid, benterx, bentery, benterz, bexitx, bexity, bexitz, binterior, bvalue, bname) VALUES (NULL,'%f','%f','%f','%f','%f','%f','%d','%d','%s')",
    pPOS[0],pPOS[1],pPOS[2], interiors[bint][posx],interiors[bint][posy],interiors[bint][posz],interiors[bint][hint],bprice,bbname);