Error ID: 1064, You have an error in your SQL syntax;
#1

Код:
format(query, sizeof(query),"INSERT INTO `vehicles` (`CarID`,`Model`,`Color1`,`Color2`,`Price`,`Owner`,`vPosX`,`vPosY`,`vPosZ`,`vPosA`,`Plate`,`PaintJ`,`Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`,");
	  	format(query, sizeof(query),"%s`Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`,`Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`FirstAid`,`Variabila`,`Component0`,`Component1`,`Component2`,`Component3`,`Component4`,`Component5`,`Component6`,`Component7`,`Component8`,`Component9`,`Component10`,`Component11`,`Component12`,`Component13`)", query);
		format(query, sizeof(query),"%s VALUES ('%d','%d','%d','%d','%d','%s','%f','%f','%f','%f','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
		query,
		Total_Veh_Created,
		ivModel,
		ivColors[0],
		ivColors[1],
		ivPrice,
		vInfo[Total_Veh_Created][vOwner],
		Pos[0],
		Pos[1],
		Pos[2],
		Pos[3],
		vInfo[Total_Veh_Created][vPlate],
		vInfo[Total_Veh_Created][vPaintJ],
		vInfo[Total_Veh_Created][vLocked],
		vInfo[Total_Veh_Created][vCarCode],
		vInfo[Total_Veh_Created][vOre],
		vInfo[Total_Veh_Created][vVodo],
		vInfo[Total_Veh_Created][vTowed],
		vInfo[Total_Veh_Created][trWeapon1],
	    vInfo[Total_Veh_Created][trWeapon2],
	    vInfo[Total_Veh_Created][trWeapon3],
		vInfo[Total_Veh_Created][trWeapon4],
		vInfo[Total_Veh_Created][trWeapon5],
		vInfo[Total_Veh_Created][trWeapon6],
		vInfo[Total_Veh_Created][trAmmo1],
		vInfo[Total_Veh_Created][trAmmo2],
		vInfo[Total_Veh_Created][trAmmo3],
	    vInfo[Total_Veh_Created][trAmmo4],
	    vInfo[Total_Veh_Created][trAmmo5],
		vInfo[Total_Veh_Created][trAmmo6],
	    vInfo[Total_Veh_Created][tMedkit],
	    vInfo[Total_Veh_Created][vVariabila],
	    vInfo[Total_Veh_Created][vComponent0],
	    vInfo[Total_Veh_Created][vComponent1],
	    vInfo[Total_Veh_Created][vComponent2],
	    vInfo[Total_Veh_Created][vComponent3],
	    vInfo[Total_Veh_Created][vComponent4],
	    vInfo[Total_Veh_Created][vComponent5],
	    vInfo[Total_Veh_Created][vComponent6],
	    vInfo[Total_Veh_Created][vComponent7],
	    vInfo[Total_Veh_Created][vComponent8],
	    vInfo[Total_Veh_Created][vComponent9],
	    vInfo[Total_Veh_Created][vComponent10],
	    vInfo[Total_Veh_Created][vComponent11],
	    vInfo[Total_Veh_Created][vComponent12],
	    vInfo[Total_Veh_Created][vComponent13]);
		mysql_query(query);
Error

CMySQLHandler::Query(INSERT INTO `vehicles` (`CarID`,`Model`,`Color1`,`Color2`,`Price`,`Owner` ,`vPosX`,`vPosY`,`vPosZ`,`vPosA`,`Plate`,`PaintJ`, `Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`,` Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`,` Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`Fi rstAid`,`Variabila`,`Component0`,`Component1`,`Com ponent2`,`Component3`,`Component4`,`Component5`,`C omponent6`,`Component7`,`Component8`,`Component9`, `Component10`,`Component11`,`Component12`,`Compone nt13`) VALUES ('5','400','2','2','12','Unbought','1386.406005','-1620.778320','17.023591','274.569885','Numar','6', '0','488','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)


I check and wverything looks ok :\
Reply
#2

Try this. It should work.
Код:
strdel(query, 0, strlen(query)); // this is just debug 'query' must be empty or you will have errors
strcat(query, "INSERT INTO `vehicles` (`CarID`,`Model`,`Color1`,`Color2`,`Price`,`Owner`,`vPosX`,`vPosY`,`vPosZ`,`vPosA`,`Plate`,`PaintJ`,`Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`,");
strcat(query, " `Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`,`Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`FirstAid`,`Variabila`,`Component0`,`Component1`,`Component2`,`Component3`,`Component4`,`Component5`,`Component6`,`Component7`,`Component8`,`Component9`,`Component10`,`Component11`,`Component12`,`Component13`)");
strcat(query, " VALUES ('%d','%d','%d','%d','%d','%s','%f','%f','%f','%f','%s','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')");
format(query, sizeof(query), query, Total_Veh_Created, ivModel, ivColors[0], ivColors[1], ivPrice, vInfo[Total_Veh_Created][vOwner], Pos[0], Pos[1], Pos[2], Pos[3], vInfo[Total_Veh_Created][vPlate], vInfo[Total_Veh_Created][vPaintJ],
vInfo[Total_Veh_Created][vLocked], vInfo[Total_Veh_Created][vCarCode], vInfo[Total_Veh_Created][vOre], vInfo[Total_Veh_Created][vVodo], vInfo[Total_Veh_Created][vTowed], vInfo[Total_Veh_Created][trWeapon1], vInfo[Total_Veh_Created][trWeapon2],
vInfo[Total_Veh_Created][trWeapon3], vInfo[Total_Veh_Created][trWeapon4], vInfo[Total_Veh_Created][trWeapon5], vInfo[Total_Veh_Created][trWeapon6], vInfo[Total_Veh_Created][trAmmo1], vInfo[Total_Veh_Created][trAmmo2], vInfo[Total_Veh_Created][trAmmo3],
vInfo[Total_Veh_Created][trAmmo4], vInfo[Total_Veh_Created][trAmmo5], vInfo[Total_Veh_Created][trAmmo6], vInfo[Total_Veh_Created][tMedkit], vInfo[Total_Veh_Created][vVariabila], vInfo[Total_Veh_Created][vComponent0], vInfo[Total_Veh_Created][vComponent1],
vInfo[Total_Veh_Created][vComponent2], vInfo[Total_Veh_Created][vComponent3], vInfo[Total_Veh_Created][vComponent4], vInfo[Total_Veh_Created][vComponent5], vInfo[Total_Veh_Created][vComponent6], vInfo[Total_Veh_Created][vComponent7], vInfo[Total_Veh_Created][vComponent8],
vInfo[Total_Veh_Created][vComponent9], vInfo[Total_Veh_Created][vComponent10], vInfo[Total_Veh_Created][vComponent11], vInfo[Total_Veh_Created][vComponent12], vInfo[Total_Veh_Created][vComponent13]);
mysql_query(query);
Reply
#3

Hi
Now i have this 2 error but i use the command one time
Quote:

[12:55:18] CMySQLHandler::Query(INSERT INTO `vehicles` (`CarID`,`Model`,`Color1`,`Color2`,`Price`,`Owner` ,`vPosX`,`vPosY`,`vPosZ`,`vPosA`,`Plate`,`PaintJ`, `Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`, `Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`, `Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`F irstAid`,`Variabila`,`Component0`,`Component1`,`Co mponent2`,`Component3`,`Component4`,`Component5`,` Component6`,`Component7`,`Component8`,`Component9` ,`Component10`,`Component11`,`Component12`,`Compon ent13`) VALUES ('2','411','23','3','23','Unbought','1390.675659', '-1605.935913','13.553950','344.810974','BRISTON','6 ','0','777','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)

[12:55:18] >> mysql_query( Connection handle: 1 )

[12:55:18] CMySQLHandler::Query(INSERT INTO `vehicles` (`CarID`,`Model`,`Color1`,`Color2`,`Price`,`Owner` ,`vPosX`,`vPosY`,`vPosZ`,`vPosA`,`Plate`,`PaintJ`, `Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`, `Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`, `Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`F irstAid`,`Variabila`,`Component0`,`Component1`,`Co mponent2`,`Component3`,`Component4`,`Component5`,` Component6`,`Component7`,`Component8`,`Component9` ,`Component10`,`Component11`,`Component12`,`Compon ent13`) VALUES ('2','411','23','3','23','Unbought','1390.675659', '-1605.935913','13.553950','344.810974','BRISTON','6 ','0','777','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)

Reply
#4

What version of MySQL you are using?
Reply
#5

mysql r5
Reply
#6

This is the same but with more spaces I think it will help to fix the problem
Код:
strdel(query, 0, strlen(query));
strcat(query, "INSERT INTO `vehicles` (`CarID`, `Model`, `Color1`, `Color2`, `Price`, `Owner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `Plate`, `PaintJ`, `Locked`, `Carcode`, `OreC`, `KM`, `Towed`, `Weapon1`,");
strcat(query, " `Weapon2`, `Weapon3`, `Weapon4`, `Weapon5`, `Weapon6`, `Ammo1`, `Ammo2`, `Ammo3`, `Ammo4`, `Ammo5`, `Ammo6`, `FirstAid`, `Variabila`, `Component0`, `Component1`, `Component2`, `Component3`, `Component4`, `Component5`, `Component6`, `Component7`, `Component8`, `Component9`, `Component10`, `Component11`, `Component12`, `Component13`)");
strcat(query, " VALUES ('%d', '%d', '%d', '%d', '%d', '%s', '%f', '%f', '%f', '%f', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')");
format(query, sizeof(query), query, Total_Veh_Created, ivModel, ivColors[0], ivColors[1], ivPrice, vInfo[Total_Veh_Created][vOwner], Pos[0], Pos[1], Pos[2], Pos[3], vInfo[Total_Veh_Created][vPlate], vInfo[Total_Veh_Created][vPaintJ],
vInfo[Total_Veh_Created][vLocked], vInfo[Total_Veh_Created][vCarCode], vInfo[Total_Veh_Created][vOre], vInfo[Total_Veh_Created][vVodo], vInfo[Total_Veh_Created][vTowed], vInfo[Total_Veh_Created][trWeapon1], vInfo[Total_Veh_Created][trWeapon2],
vInfo[Total_Veh_Created][trWeapon3], vInfo[Total_Veh_Created][trWeapon4], vInfo[Total_Veh_Created][trWeapon5], vInfo[Total_Veh_Created][trWeapon6], vInfo[Total_Veh_Created][trAmmo1], vInfo[Total_Veh_Created][trAmmo2], vInfo[Total_Veh_Created][trAmmo3],
vInfo[Total_Veh_Created][trAmmo4], vInfo[Total_Veh_Created][trAmmo5], vInfo[Total_Veh_Created][trAmmo6], vInfo[Total_Veh_Created][tMedkit], vInfo[Total_Veh_Created][vVariabila], vInfo[Total_Veh_Created][vComponent0], vInfo[Total_Veh_Created][vComponent1],
vInfo[Total_Veh_Created][vComponent2], vInfo[Total_Veh_Created][vComponent3], vInfo[Total_Veh_Created][vComponent4], vInfo[Total_Veh_Created][vComponent5], vInfo[Total_Veh_Created][vComponent6], vInfo[Total_Veh_Created][vComponent7], vInfo[Total_Veh_Created][vComponent8],
vInfo[Total_Veh_Created][vComponent9], vInfo[Total_Veh_Created][vComponent10], vInfo[Total_Veh_Created][vComponent11], vInfo[Total_Veh_Created][vComponent12], vInfo[Total_Veh_Created][vComponent13]);
mysql_query(query);
Reply
#7

Shit this error is very annoying

Код:
CMySQLHandler::Query(INSERT INTO `vehicles` (`CarID`, `Model`, `Color1`, `Color2`, `Price`, `Owner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `Plate`, `PaintJ`, `Locked`, `Carcode`, `OreC`, `KM`, `Towed`, `Weapon1`, `Weapon2`, `Weapon3`, `Weapon4`, `Weapon5`, `Weapon6`, `Ammo1`, `Ammo2`, `Ammo3`, `Ammo4`, `Ammo5`, `Ammo6`, `FirstAid`, `Variabila`, `Component0`, `Component1`, `Component2`, `Component3`, `Component4`, `Component5`, `Component6`, `Component7`, `Component8`, `Component9`, `Component10`, `Component11`, `Component12`, `Component13`) VALUES ('1', '411', '1', '1', '1', 'Unbought', '1386.137939', '-1622.340087', '14.686663', '270.999969', 'BRISTON', '6', '0', '435', '0', '0', '0', '0', '0', '0', '0', '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)
Reply
#8

Try now
Код:
format(query, sizeof(query), "INSERT INTO `vehicles` (`CarID`, `Model`, `Color1`, `Color2`, `Price`, `Owner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `Plate`, `PaintJ`, `Locked`, `Carcode`, `OreC`, `KM`, `Towed`, `Weapon1`, \
`Weapon2`, `Weapon3`, `Weapon4`, `Weapon5`, `Weapon6`, `Ammo1`, `Ammo2`, `Ammo3`, `Ammo4`, `Ammo5`, `Ammo6`, `FirstAid`, `Variabila`, `Component0`, `Component1`, `Component2`, `Component3`, `Component4`, `Component5`, `Component6`, `Component7`, `Component8`, `Component9`, `Component10`, `Component11`, `Component12`, `Component13`) \
VALUES (%d, %d, %d, %d, %d, '%s', '%f', '%f', '%f', '%f', '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)",
Total_Veh_Created, ivModel, ivColors[0], ivColors[1], ivPrice, vInfo[Total_Veh_Created][vOwner], Pos[0], Pos[1], Pos[2], Pos[3], vInfo[Total_Veh_Created][vPlate], vInfo[Total_Veh_Created][vPaintJ],
vInfo[Total_Veh_Created][vLocked], vInfo[Total_Veh_Created][vCarCode], vInfo[Total_Veh_Created][vOre], vInfo[Total_Veh_Created][vVodo], vInfo[Total_Veh_Created][vTowed], vInfo[Total_Veh_Created][trWeapon1], vInfo[Total_Veh_Created][trWeapon2],
vInfo[Total_Veh_Created][trWeapon3], vInfo[Total_Veh_Created][trWeapon4], vInfo[Total_Veh_Created][trWeapon5], vInfo[Total_Veh_Created][trWeapon6], vInfo[Total_Veh_Created][trAmmo1], vInfo[Total_Veh_Created][trAmmo2], vInfo[Total_Veh_Created][trAmmo3],
vInfo[Total_Veh_Created][trAmmo4], vInfo[Total_Veh_Created][trAmmo5], vInfo[Total_Veh_Created][trAmmo6], vInfo[Total_Veh_Created][tMedkit], vInfo[Total_Veh_Created][vVariabila], vInfo[Total_Veh_Created][vComponent0], vInfo[Total_Veh_Created][vComponent1],
vInfo[Total_Veh_Created][vComponent2], vInfo[Total_Veh_Created][vComponent3], vInfo[Total_Veh_Created][vComponent4], vInfo[Total_Veh_Created][vComponent5], vInfo[Total_Veh_Created][vComponent6], vInfo[Total_Veh_Created][vComponent7], vInfo[Total_Veh_Created][vComponent8],
vInfo[Total_Veh_Created][vComponent9], vInfo[Total_Veh_Created][vComponent10], vInfo[Total_Veh_Created][vComponent11], vInfo[Total_Veh_Created][vComponent12], vInfo[Total_Veh_Created][vComponent13]);
mysql_query(query);
Reply
#9

Quote:

error 075: input line too long (after substitutions)
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "INSERT"
: error 017: undefined symbol "INTO"
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

i put more " \ "
and steal this error
Reply
#10

This?
Код:
strdel(query, 0, strlen(query));
strcat(query, "INSERT INTO `vehicles` (`CarID`, `Model`, `Color1`, `Color2`, `Price`, `Owner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `Plate`, `PaintJ`, `Locked`,`Carcode`,`OreC`,`KM`,`Towed`,`Weapon1`,");
strcat(query, " `Weapon2`,`Weapon3`,`Weapon4`,`Weapon5`,`Weapon6`,`Ammo1`,`Ammo2`,`Ammo3`,`Ammo4`,`Ammo5`,`Ammo6`,`FirstAid`,`Variabila`,`Component0`,`Component1`,`Component2`,`Component3`,`Component4`,`Component5`,`Component6`,`Component7`,`Component8`,`Component9`,`Component10`,`Component11`,`Component12`,`Component13`)");
strcat(query, " VALUES VALUES (%d, %d, %d, %d, %d, '%s', '%f', '%f', '%f', '%f', '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)");
format(query, sizeof(query), query, Total_Veh_Created, ivModel, ivColors[0], ivColors[1], ivPrice, vInfo[Total_Veh_Created][vOwner], Pos[0], Pos[1], Pos[2], Pos[3], vInfo[Total_Veh_Created][vPlate], vInfo[Total_Veh_Created][vPaintJ],
vInfo[Total_Veh_Created][vLocked], vInfo[Total_Veh_Created][vCarCode], vInfo[Total_Veh_Created][vOre], vInfo[Total_Veh_Created][vVodo], vInfo[Total_Veh_Created][vTowed], vInfo[Total_Veh_Created][trWeapon1], vInfo[Total_Veh_Created][trWeapon2],
vInfo[Total_Veh_Created][trWeapon3], vInfo[Total_Veh_Created][trWeapon4], vInfo[Total_Veh_Created][trWeapon5], vInfo[Total_Veh_Created][trWeapon6], vInfo[Total_Veh_Created][trAmmo1], vInfo[Total_Veh_Created][trAmmo2], vInfo[Total_Veh_Created][trAmmo3],
vInfo[Total_Veh_Created][trAmmo4], vInfo[Total_Veh_Created][trAmmo5], vInfo[Total_Veh_Created][trAmmo6], vInfo[Total_Veh_Created][tMedkit], vInfo[Total_Veh_Created][vVariabila], vInfo[Total_Veh_Created][vComponent0], vInfo[Total_Veh_Created][vComponent1],
vInfo[Total_Veh_Created][vComponent2], vInfo[Total_Veh_Created][vComponent3], vInfo[Total_Veh_Created][vComponent4], vInfo[Total_Veh_Created][vComponent5], vInfo[Total_Veh_Created][vComponent6], vInfo[Total_Veh_Created][vComponent7], vInfo[Total_Veh_Created][vComponent8],
vInfo[Total_Veh_Created][vComponent9], vInfo[Total_Veh_Created][vComponent10], vInfo[Total_Veh_Created][vComponent11], vInfo[Total_Veh_Created][vComponent12], vInfo[Total_Veh_Created][vComponent13]);
mysql_query(query);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)