MySQL Error, not sure what though
#1

Alright. I've decided to come back to SA-MP scripting..


Anyways, This query should work but it is not returning any rows:

pawn Код:
Function:OnAccountLoad(playerid)
    {
        new
            rows,
            fields;

        cache_get_data(rows, fields);

        if(rows == 1)
        {
            for(new i = 0; i != rows; i++)
            {

                // Load Strings ----------------------------------------------------
                cache_get_field_content(i, "Password", Account[playerid][Password]);
                // -----------------------------------------------------------------

                // Load Integers ------------------------------------------------------------
                Account[playerid][AdminLevel] = cache_get_field_content_int(i, "AdminLevel");
                Account[playerid][Money] = cache_get_field_content_int(i, "money");
                Account[playerid][Faction] = cache_get_field_content_int(i, "faction");
                Account[playerid][pSkin] = cache_get_field_content_int(i, "skin");
                Account[playerid][pGender] = cache_get_field_content_int(i, "gender");
                // --------------------------------------------------------------------------
               
                // Set Money ----------------------------------------
                ResetPlayerMoney(playerid);
                GivePlayerMoney(playerid, Account[playerid][Money]);
                // --------------------------------------------------

                // Set Clothes -----------------------------------
                SetPlayerSkin(playerid, Account[playerid][pSkin]);
                // -----------------------------------------------

            }
        }
        else
        {
            SCM(playerid, -1, "Failed to load user data... [FTL ERR #1]");
            KickDelay(playerid);
        }
        return 1;
    }
Here's the query:

pawn Код:
mysql_format(sqlHandle, gVar3000, sizeof(gVar3000), "SELECT * FROM `samp_users` WHERE 'Username' = '%e' AND Password = '%e'", Name[playerid], Account[playerid][Password]);
        mysql_tquery(sqlHandle, gVar3000, "OnAccountLoad", "d", playerid);
Reply


Messages In This Thread
MySQL Error, not sure what though - by sammp - 23.10.2014, 19:18
Re: MySQL Error, not sure what though - by dusk - 23.10.2014, 19:22
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 19:24
Re: MySQL Error, not sure what though - by dusk - 23.10.2014, 19:28
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 19:30
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 19:33
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 21:58
Re: MySQL Error, not sure what though - by TakeiT - 23.10.2014, 22:11
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 22:25
Re: MySQL Error, not sure what though - by sammp - 23.10.2014, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)