Any password works - Mysql
#4

I actually used part of your tutorial for this, I'm also having an issue where it only says login, while the account doesn't exist. I'll show the onplayerconnect and login dialog code.

OnPlayerConnect
pawn Код:
format(str,sizeof(str),"SELECT * FROM "SQL_ACCOUNT_TABLE" WHERE User = '%s'",pName2(playerid));
    mysql_query(str);
    mysql_store_result();
    if (mysql_num_rows() == 1)
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "[::] Login", "Please enter your password below to login.", "Login", "");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "[::] Register", "Please enter your password below to register.", "Register", "");
    }

And the Login Dialog:
pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                new
                    HashedPW[145],
                    str[1024];
               
                mysql_real_escape_string(inputtext, HashedPW);
                WP_Hash(HashedPW, sizeof (HashedPW), inputtext);
                format(str, sizeof(str), "SELECT * FROM "SQL_ACCOUNT_TABLE" WHERE User = '%s' AND pPass = '%s'", pName2(playerid), HashedPW);
                mysql_query(str);
                InitiateLogin(playerid);
            }
        }
Reply


Messages In This Thread
Any password works - Mysql - by Abreezy - 29.01.2012, 21:25
Re: SQL syntax error - by jamesbond007 - 29.01.2012, 21:31
Re: Any password works - Mysql - by [HiC]TheKiller - 29.01.2012, 21:43
Re: Any password works - Mysql - by Abreezy - 29.01.2012, 21:46
Re: Any password works - Mysql - by [HiC]TheKiller - 29.01.2012, 21:49
Re: Any password works - Mysql - by Abreezy - 29.01.2012, 21:52
Re: Any password works - Mysql - by [HiC]TheKiller - 29.01.2012, 22:03
Re: Any password works - Mysql - by Abreezy - 29.01.2012, 22:07
Re: Any password works - Mysql - by Abreezy - 29.01.2012, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)