MySQL error - 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 (
/showthread.php?tid=635973)
MySQL error -
Antenastyle - 17.06.2017
I'm making a new GM and I have this error
Lines:
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(!response)return Kick(playerid);
if(strlen(inputtext) < 3 || strlen(inputtext) > 30){
ShowRegisterDialog(playerid, "Your password must be between 3 and 30 characters.");
}
new query[128];
mysql_format(sqlConnection, query, sizeof(query), "INSERT INTO users(Name, Pass, IP) VALUES('%e', sha1('%e'), '%e')", GetName(playerid), inputtext, GetIP(playerid));
mysql_pquery(sqlConnection, query, "SQL_OnAccountRegister", "i", playerid);
}
}
return false;
}
Re: MySQL error -
BiosMarcel - 17.06.2017
1. stop using sha1, it's proven insecure.
2. why is there a '?' char (i dunno how its called)? Might there be something wrong with your encoding?
3. Indent your code properly or atleast have some convention that you follow
4. Try to enter the query, that mysql_format creates, into interface/console and see if it works
Re: MySQL error -
Antenastyle - 17.06.2017
Quote:
Originally Posted by [Bios]Marcel
1. stop using sha1, it's proven insecure.
2. why is there a '?' char (i dunno how its called)? Might there be something wrong with your encoding?
3. Indent your code properly or atleast have some convention that you follow
4. Try to enter the query, that mysql_format creates, into interface/console and see if it works
|
1,3 and 4 are done. I've entered the query into the interface and it worked, I don't know why isn't working in-game.
The second point, I don't know why is there a ? character, but it never happened...
Re: MySQL error -
BiosMarcel - 17.06.2017
I think i am not qualified enough to provide further help in this case :/
Good luck tho.
P.s: don't let people create 3 char password, should be atleast 7 or 8 :P