MySQL problem - Custom code will always login (even if account does not exist)
#5

I've got this also:

pawn Код:
new escapedPlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        mysql_real_escape_string(PlayerName, escapedPlayerName);
        format(string, sizeof(string), "SELECT * FROM Users WHERE Name = '%s'", escapedPlayerName);
        mysql_query(string, THREAD_USER_LOOKUP, playerid, MySQLConnection);
and THREAD_USER_LOOKUP responses to this:

pawn Код:
case THREAD_USER_LOOKUP:
        {
            mysql_store_result(connectionHandle);
            if(mysql_num_rows(connectionHandle) > 0)
            {
                new Return[256];
                mysql_retrieve_row();

                cache_get_field_content(0, "VIP", Return);
                PlayerInfo[extraid][pTempVIP] = strval(Return);
               
                cache_get_field_content(0, "Admin", Return);
                PlayerInfo[extraid][pTempAdmin] = strval(Return);

                cache_get_field_content(0, "Password", Return);
                format(PlayerInfo[extraid][pPassword], 256, Return);

                mysql_free_result(connectionHandle);

                ShowPlayerDialog(extraid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_PASSWORD, "Server Login", "Server Login:\n\nThe account with the name you joined is already registered!\nType your password below to retrieve your stats!", "Login", "");
            }
            else
            {
                ShowPlayerDialog(extraid, DIALOG_TYPE_REGISTER, DIALOG_STYLE_INPUT, "Server Register", "Server Register:\n\nThe account with the name you joined is not yet registered!\nType your password below to save your stats!\n\nNote: Do not press ESC or you will be kicked.", "Register", "Kick");
            }
        }
But it wont show anything at all...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)