MySQL error
#1

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;
}
Reply
#2

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
Reply
#3

Quote:
Originally Posted by [Bios]Marcel
View Post
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...
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)