Mysql Errorid 1064
#8

Thanks all. No errors now.
Only i have a problem with logging in.
When i enter the right password the server stops running.
OnDialogResponse:
pawn Code:
case 0:
        {
            if(!response)return Kick(playerid);
            mysql_format(gConnectionHandle, Query , "SELECT * FROM `users` WHERE `Username` = '%s' AND `Password` = md5('%s')",GetName(playerid),inputtext);
            mysql_function_query(gConnectionHandle , Query , false ,"LoginPlayer" , "ii" , playerid,inputtext);
        }
        case 1:
        {
            if(!response)return Kick(playerid);
            new IP[50];
            GetPlayerIp(playerid,IP,sizeof (IP));
            mysql_format(gConnectionHandle, Query, "INSERT INTO `users` (`Username`, `Password`, `Money`, `Score`, `Admin`, `Kills`, `Deaths`, `IP`) VALUES('%s' , md5('%s'), 5000, 0, 0, 0, 0, '%s')",GetName(playerid),inputtext,IP);
            mysql_function_query(gConnectionHandle, Query, false , "OnQueryFinish", "ii",Query);
            GivePlayerMoney(playerid,5000);
            SetPlayerScore(playerid,0);
        }
LoginPlayer check:
pawn Code:
public LoginPlayer(playerid,password)
{
    mysql_store_result();
    if(mysql_num_rows(gConnectionHandle) == 1)
    {
        if(mysql_retrieve_row())
        {
            mysql_fetch_field_row(mysqlstring, "Money"); GivePlayerMoney(playerid,strval(mysqlstring));
            mysql_fetch_field_row(mysqlstring, "Score"); SetPlayerScore(playerid,strval(mysqlstring));
            mysql_fetch_field_row(mysqlstring, "Admin"); PlayerInfo[playerid][pAdmin] = strval(mysqlstring);
            mysql_fetch_field_row(mysqlstring, "Kills"); PlayerInfo[playerid][pKills] = strval(mysqlstring);
            mysql_fetch_field_row(mysqlstring, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(mysqlstring);
            SendClientMessage(playerid,-1,"Succesfull Logged IN!");
        }
    }
    else
    {
        SetPVarInt(playerid,"WrongPassword", GetPVarInt(playerid , "WrongPassword") + 1);
        if(GetPVarInt(playerid,"WrongPassword")==3)
        {
            SendClientMessage(playerid,-1,"Kicked From Server , Reason : Failed Logins !");
            return Kick(playerid);
        }
        format(mysqlstring,sizeof (mysqlstring),"Welcome %s /n Type your password below to Login on your CnR Account!",GetName(playerid));
        ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_PASSWORD, "Login on your CnR Account!",mysqlstring,"OK","Cancel");
        SendClientMessage(playerid,-1,"Wrong Password!");
    }
    mysql_free_result();
    return 1;
}
How can i fix this?
Reply


Messages In This Thread
Mysql Errorid 1064 - by Admigo - 18.02.2013, 17:57
Re: Mysql Errorid 1064 - by Gamer_Z - 18.02.2013, 18:03
Re: Mysql Errorid 1064 - by Shaneisace - 18.02.2013, 18:04
Re: Mysql Errorid 1064 - by Admigo - 18.02.2013, 18:18
Re: Mysql Errorid 1064 - by Vince - 18.02.2013, 20:17
Re: Mysql Errorid 1064 - by Shaneisace - 19.02.2013, 02:26
Re: Mysql Errorid 1064 - by 3ventic - 19.02.2013, 09:03
Re: Mysql Errorid 1064 - by Admigo - 19.02.2013, 17:46
Re: Mysql Errorid 1064 - by Gamer_Z - 19.02.2013, 20:35
Re: Mysql Errorid 1064 - by BlackBank - 19.02.2013, 20:52

Forum Jump:


Users browsing this thread: 2 Guest(s)