Help regarding about mysql
#1

Hello, Today I decided to use MySQL instead of y_ini but the problem is, when I try to register my account the account saves on my database and then I logged in with the similar password It let me login to the server even though it is wrong password.

For Example:
Username:KizZweLL
Password:NoobAtMysql


then I tried to login with this password

Password:NoobAtMysqls
I came up on joining the server even though it is a wrong password.
Please help me to fix this.

here's my Code:
PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch (
dialogid)
    {
        case 
LOGIN:
        {
            if(
response)
            {
                new 
query[126] , Name[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,Name,sizeof(Name));
                
format(query,sizeof(query),"SELECT * FROM users WHERE name = '%s' AND password = '%s'",Name,inputtext);
                
mysql_query(query);
                
mysql_store_result();
                
                if(
mysql_num_rows() == 1)
                {
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playeridREGISTERDIALOG_STYLE_INPUT""Caption"Register",""Red"You have entered an invalid password.\n"White"Type your password below to register a new account.","Register","Quit");
                }
            }
        } 
My database format is
users:
account password.
Reply
#2

I would suggest using a more updated MySQL plugin.

https://sampforum.blast.hk/showthread.php?tid=56564
Reply
#3

I have downloaded version r6 but when I open my server the plugin loaded was version r5.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)