sql error
#1

hello,

me script bug :/

Код:
public CreateCommerce(Float:X,Float:Y,Float:Z,VW,INT,Float:X1,Float:Y1,Float:Z1,VW1,INT1,PRIX,TYPES)
{
    new string[1024]; 
    c_info[totalcommerce][c_id] = mysql_insert_id();
	format(string, 1024, "INSERT INTO commerce c_id,c_nom,c_ext_x,c_ext_y,c_ext_z,c_ext_int,c_ext_vw,c_int_x,c_int_y,c_int_z,c_int_int,c_int_vw,c_prix,c_type) \
	VALUES (%d,'Aucun',%f,%f,%f,%d,%d,%f,%f,%f,%d,%d,%d,%d)",
	c_info[totalcommerce][c_id],X,Y,Z,INT,VW,X1,Y1,Z1,INT1,VW1,PRIX,TYPES);
	mysql_function_query(mysql, string, false, "SendQuery", "");
	//LoadCommerce(totalcommerce);
	totalcommerce++;
	return 1;
}
Код:
[19:22:34] [OnQueryError] Error ID: 1064
[19:22:34] [OnQueryError] Error: 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 'c_id,c_nom,c_ext_x,c_ext_y,c_ext_z,c_ext_int,c_ext_vw,c_int_x,c_int_y,c_int_z,c_' at line 1
[19:22:34] [OnQueryError] Callback: SendQuery
[19:22:34] [OnQueryError] Query: INSERT INTO commerce c_id,c_nom,c_ext_x,c_ext_y,c_ext_z,c_ext_int,c_ext_vw,c_int_x,c_int_y,c_int_z,c_int_int,c_int_vw,c_prix,c_type) VALUES (0,'Aucun',1427.535156,-1085.696655,17.559257,0,0,-25.884498,-185.868988,1003.546875,17,547,200,1)
[19:22:34] [OnQueryError] Connection handle: 1
and

Код:
public SaveCommerce(id)
{
    new string1[1024];
        //Juste un ajout d'antislash en dessous la
    format(string1, sizeof(string1), \
    "UPDATE commerce SET c_nom = '%s', c_ext_x = %f, c_ext_y = %f, c_ext_z = %f, c_ext_int = %d,c_ext_vw = %d, c_int_x = %f, c_int_y = %f, c_int_z = %f, \
    c_int_int = %d, c_int_vw = %d, c_proprio = '%s', c_caisse = %d, c_braquer = %d, c_coffre = %d, c_coffrearme = %d, c_coffrearme1 = %d, c_coffrearme2 = %d, \
    c_coffrearme3 = %d,c_coffrearm4 = %d,c_coffremun = %d, c_coffremun1 = %d, c_coffremun2 = %d, c_coffremun3 = %d, c_coffremun4 = %d, \
    c_coffreweed = %d, c_coffrecanabis = %d, c_coffregraine = %d, c_coffrematos = %d WHERE c_id = %d",c_info[id][c_nom],c_info[id][c_ext_x],c_info[id][c_ext_y],c_info[id][c_ext_z],c_info[id][c_ext_int],c_info[id][c_ext_vw],
    c_info[id][c_int_x],c_info[id][c_int_y],c_info[id][c_int_z],c_info[id][c_int_int],c_info[id][c_int_vw],c_info[id][c_proprio],
    c_info[id][c_caisse],c_info[id][c_braquer],c_info[id][c_coffre],c_info[id][c_coffrearme][0],c_info[id][c_coffrearme][1],
    c_info[id][c_coffrearme][2],c_info[id][c_coffrearme][3],c_info[id][c_coffrearme][4],c_info[id][c_coffremun][0],c_info[id][c_coffremun][1],
    c_info[id][c_coffremun][2],c_info[id][c_coffremun][3],c_info[id][c_coffremun][4],c_info[id][c_coffreweed],c_info[id][c_coffrecanabis],
    c_info[id][c_coffregraine],c_info[id][c_coffrematos],c_info[id][c_id]);
    return 1;
}

error 075: input line too long (after substitutions)
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "UPDATE"
error 017: undefined symbol "commerce"
fatal error 107: too many error messages on one line
Thank You
Reply
#2

wiki.sa-mp.com/wiki/Strcat

Use Strcat for the input line being too long.
Reply
#3

Increase string value upto 3000 and use strcat
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)