mysql error [+4rep]
#1

Hello,
My error mysql for the requet

Код:
format(string, 256, "INSERT INTO `comptes` (p_nom,p_mdp,p_email,p_origine,p_inscription_id,p_sexe) VALUES (%s, %s, %s, %d, %s, %d)",name, inputtext, inscription_email[playerid],inscription_origine[playerid],returnIp(playerid),inscription_sexe[playerid]);

mysql_function_query(mysql, string, false, "", "");

[12:12:38] Passing query INSERT INTO `comptes` (p_nom,p_mdp,p_email,p_origine,p_inscription_id,p_sexe) VALUES (DarkZeroX, teste, teste@laposte.net, 1, 127.0.0.1, 1) |
Thank You

(my bad english :/)
Reply
#2

I think strings need to be in qoates in a mysql query, can you give this a try? :
pawn Код:
format(string, 256, "INSERT INTO `comptes` ('p_nom','p_mdp','p_email',p_origine,'p_inscription_id',p_sexe) VALUES (%s, %s, %s, %d, %s, %d)",name, inputtext, inscription_email[playerid],inscription_origine[playerid],returnIp(playerid),inscription_sexe[playerid]);
Reply
#3

Quote:
Originally Posted by Conradus
Посмотреть сообщение
I think strings need to be in qoates in a mysql query, can you give this a try?
You are correct about the quotes, but you still placed them in the wrong place. It is the values that need to be enclosed, not the field names;
PHP код:
 INSERT INTO comptes (p_nom,p_mdp,p_email,p_origine,p_inscription_id,p_sexeVALUES ('%s''%s''%s', %d'%s', %d
And @OP: NEVER pass inputtext directly into a query! This is extremely dangerous. Use mysql_format or mysql_real_escape_string when inserting user input (from a text, command or dialogbox) into a query.
Reply
#4

No :/

[12:48:43] Passing query INSERT INTO comptes (p_nom,p_mdp,p_email,p_origine,p_inscription_id,p_ sexe,p_code) VALUES ('DarkZeroX', 'test', 'test@laposte.net', 1, '127.0.0.1', 1, 6322)
Reply
#5

I suggest you to use:
pawn Код:
format(string, 256, "INSERT INTO `comptes` (p_nom,p_mdp,p_email,p_origine,p_inscription_id,p_sexe) VALUES ('%s', '%s', '%s', '%d', '%s', '%d')",name, inputtext, inscription_email[playerid],inscription_origine[playerid],returnIp(playerid),inscription_sexe[playerid]);
test it ...
+ What Vince said, using mysql_escape_string is important.
Edit: No reputation received LOL Nab when your problem solved give my rep lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)