Need help with SQLite
#1

Ok, I'm making a GM but when I load data I got something strange...
Here's my code:
pawn Код:
if(dialogid == LOG_DIALOG)
    {
        if(response)
        {
            format(Query, sizeof(Query), "SELECT * FROM `Utenti` WHERE `Nome` = '%s' AND `Password` = '%s'", Nome(playerid), inputtext);
            result = db_query(database, Query);
            if(db_num_rows(result) != 0) //Password corretta
            {
                db_get_field_assoc(result, "Password", Utente[playerid][Password], 16);
                db_get_field_assoc(result, "Livello", Utente[playerid][Livello], 6);
                db_get_field_assoc(result, "Soldi", Utente[playerid][Soldi], 16);
                db_get_field_assoc(result, "Banca", Utente[playerid][Banca], 16);
                db_get_field_assoc(result, "Skin", Utente[playerid][Skin], 6);
                db_get_field_assoc(result, "Bannato", Utente[playerid][Bannato], 3);
                db_free_result(result);
                SendClientMessage(playerid, 0x0000D9AA, "Hai eseguito l'accesso!");
                Loggato[playerid] = true;
                SpawnPlayer(playerid);
            }
//etc...
Now, I made a command to check my data values:
pawn Код:
CMD:mystats(playerid, params[])
{
    #pragma unused params
    new tmpstr[100];
    format(tmpstr,sizeof(tmpstr), "Pass: %s | Livello: %d | Soldi: %d", Utente[playerid][Password], Utente[playerid][Livello], Utente[playerid][Soldi]);
    SendClientMessage(playerid, 0xF60000AA, tmpstr);
    return 1;
}
In my database the values are correct, but when I type the command I get this results:
Код:
Pass: o1100 | Livello: 49 | Soldi: 49
The database values are the follows:
Код:
Pass: ok | Livello: 1 | Soldi: 100
Help me please!
Reply


Messages In This Thread
Need help with SQLite - by Zimon95 - 27.02.2011, 20:23
Re: Need help with SQLite - by JaTochNietDan - 27.02.2011, 20:26
Re: Need help with SQLite - by Zimon95 - 27.02.2011, 20:27
Re: Need help with SQLite - by JaTochNietDan - 27.02.2011, 20:32
Re: Need help with SQLite - by Zimon95 - 27.02.2011, 20:33
Re: Need help with SQLite - by dice7 - 27.02.2011, 20:35
Re: Need help with SQLite - by JaTochNietDan - 27.02.2011, 20:37
Re: Need help with SQLite - by Zimon95 - 27.02.2011, 20:38
Re: Need help with SQLite - by Fj0rtizFredde - 27.02.2011, 20:41
Re: Need help with SQLite - by Zimon95 - 27.02.2011, 20:46

Forum Jump:


Users browsing this thread: 2 Guest(s)