SA-MP Forums Archive
mysql error [+4rep] - 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 error [+4rep] (/showthread.php?tid=509657)



mysql error [+4rep] - DarkZeroX - 27.04.2014

Hello
I've a problem, look:

Код:

format(string, sizeof(string), "INSERT INTO vehicule (veh_id,veh_model, veh_posx, veh_posy, veh_posz, veh_posa, veh_c1, veh_c2,veh_proprio,veh_essence) VALUES (%d, %d, %f, %f, %f, %f, %d, %d, aucun, %d)",
totalcar,v_info[totalcar][veh_model],v_info[totalcar][veh_pos][0],v_info[totalcar][veh_pos][1],v_info[totalcar][veh_pos][2],v_info[totalcar][veh_pos][3],v_info[totalcar][veh_couleur][0],v_info[totalcar][veh_couleur][1],v_info[totalcar][veh_proprio],v_info[totalcar][veh_essence]);
mysql_function_query(mysql, string, false, "", "");
[16:07:48] Passing query INSERT INTO vehicule (veh_id,veh_model, veh_posx, veh_posy, veh_posz, veh_posa, veh_c1, veh_c2,veh_proprio,veh_essence) VALUES (49, 411, 1.100000, 2.200000, 3.299999, 4.400000, 6, 6, aucun, 0) | 
[16:07:48] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()
[16:07:48] OnQueryError() - Called.
The query displays nothing in the error console
Thank


Re: mysql error [+4rep] - Kar - 27.04.2014

pawn Код:
format(string, sizeof(string), "INSERT INTO Vehicules (veh_id, veh_model, veh_posx, veh_posy, veh_posz, veh_posa, veh_c1, veh_c2, veh_proprio, veh_essence) VALUES (%d, %d, %f, %f, %f, %f, %d, %d, %s, %d)",
totalcar,v_info[totalcar][veh_model],v_info[totalcar][veh_pos][0],v_info[totalcar][veh_pos][1],v_info[totalcar][veh_pos][2],v_info[totalcar][veh_pos][3],v_info[totalcar][veh_couleur][0],v_info[totalcar][veh_couleur][1],v_info[totalcar][veh_proprio],v_info[totalcar][veh_essence]);
mysql_function_query(mysql, string, false, "", "");
also check your vehicle table's name, are you sure it's vehicule and not vehicle?


Re: mysql error [+4rep] - DarkZeroX - 27.04.2014

There was an error in the name of the table (I forgot an s) but the error is still present

Knowing that I am French and I wrote with ****** translation so it was "Vehicules"


Re: mysql error [+4rep] - Kar - 27.04.2014

There was also another issue, you put "ascun" instead of '%s' for veh_proprio ...