MySQL problem -
Rdx - 22.12.2012
I have a problem with saving in my doors system.
Here is code:
format(query, sizeof(query), "INSERT INTO `rdx_doors` (`uid`,`akt`,`da`,`posx`,`posy`,`posz`,`blok`,`vir `,`nazwa`,`fw`,`wx`,`wy`,`wz`,`hajs`,`wvir`,`fwyj` ,`lock`,`owner`,`ownerid`,`hifi`,`vpic`,`pic`,`typ `,`obj`,`link`,`int`,`intw`) VALUES ('%d','%d','%d','%f','%f','%f','%d','%d','%s','%d' ,'%f','%f','%f','%d','%d','%d','%d','%d','%d','%d' ,'%d','%d','%d','%d','%s','%d','%d')",
uid, 1, TeleInfo[nr][tDlaAuta], TeleInfo[nr][tWejscieX], TeleInfo[nr][tWejscieY], TeleInfo[nr][tWejscieZ], 0, TeleInfo[nr][tNazwa],0,TeleInfo[nr][tWyjscieX],TeleInfo[nr][tWyjscieY],TeleInfo[nr][tWyjscieZ],0,TeleInfo[nr][tWyjscieVir],0,0,TeleInfo[nr][tOwner],TeleInfo[nr][tOwnerID],0,0,1239,0,0,"-",0,0);
And mysql error:
[00:09:09] CMySQLHandler::Query(INSERT INTO `raydexrp_doors` (`uid`,`akt`,`da`,`posx`,`posy`,`posz`,`blok`,`vir `,`nazwa`,`fw`,`wx`,`wy`,`wz`,`hajs`,`wvir`,`fwyj` ,`lock`,`owner`,`ownerid`,`hifi`,`vpic`,`pic`,`typ `,`obj`,`link`,`int`,`intw`) VALUES ('1','1','1','821.332092','-1335.198486') - 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 problem -
Vince - 22.12.2012
Hasn't it occurred to you yet that your string is too short? Also, if you're inserting into every column in the table, you might as well leave out the whole part in brackets before 'values'.
Re: MySQL problem -
Rdx - 23.12.2012
Quote:
Originally Posted by Vince
Hasn't it occurred to you yet that your string is too short? Also, if you're inserting into every column in the table, you might as well leave out the whole part in brackets before 'values'.
|
Thansk for help, string was too short.