SQLite help!
#1

This SQLite code is not loading values from the table and i don't know why.

Код:
 new Query[512], DBResult: Result, name[MAX_PLAYER_NAME], Field[20];
    GetPlayerName(playerid, name, sizeof(name));

    if(dialogid == 1)
    {
        if(response)
        {
            format(Query, sizeof(Query), "SELECT * FROM `USERS` WHERE `NAME` = '%s' AND `PASSWORD` = '%s'", DB_Escape(name), DB_Escape(inputtext));
			Result = db_query(Database, Query);
            if(db_num_rows(Result) == 1)
            {
                db_get_field_assoc(Result, "ADMIN", Field, 30);
				PlayerInfo[playerid][Admin] = strval(Field);
				db_get_field_assoc(Result, "GM", Field, 30);
				PlayerInfo[playerid][GM] = strval(Field);
				db_get_field_assoc(Result, "LEVEL", Field, 30);
				PlayerInfo[playerid][Level] = strval(Field);
				db_get_field_assoc(Result, "NOVAC", Field, 30);
				PlayerInfo[playerid][Novac] = strval(Field);
				db_get_field_assoc(Result, "BANKA", Field, 30);
				PlayerInfo[playerid][Banka] = strval(Field);
				db_get_field_assoc(Result, "POSAO", Field, 30);
				PlayerInfo[playerid][Posao] = strval(Field);
				db_get_field_assoc(Result, "UGOVOR", Field, 30);
				PlayerInfo[playerid][Ugovor] = strval(Field);
				db_get_field_assoc(Result, "MOBITEL", Field, 30);
				PlayerInfo[playerid][Mobitel] = strval(Field);
				db_get_field_assoc(Result, "LIDER", Field, 30);
				PlayerInfo[playerid][Lider] = strval(Field);
				db_get_field_assoc(Result, "CLAN", Field, 30);
				PlayerInfo[playerid][Clan] = strval(Field);
				db_get_field_assoc(Result, "RANK", Field, 30);
				PlayerInfo[playerid][Rank] = strval(Field);
				db_get_field_assoc(Result, "KAZNAUGOVOR", Field, 30);
				PlayerInfo[playerid][Kaznaugovor] = strval(Field);
				db_get_field_assoc(Result, "SATIUBANDI", Field, 30);
				PlayerInfo[playerid][Satiubandi] = strval(Field);
				db_get_field_assoc(Result, "SATIIGRE", Field, 30);
				PlayerInfo[playerid][Satiigre] = strval(Field);
				db_get_field_assoc(Result, "DRZAVA", Field, 30);
				PlayerInfo[playerid][Drzava] = strval(Field);
				db_get_field_assoc(Result, "SPOL", Field, 30);
				PlayerInfo[playerid][Spol] = strval(Field);
				db_get_field_assoc(Result, "DOB", Field, 30);
				PlayerInfo[playerid][Dob] = strval(Field);
				db_get_field_assoc(Result, "EXP", Field, 30);
				PlayerInfo[playerid][Exp] = strval(Field);
				db_get_field_assoc(Result, "VDP", Field, 30);
				PlayerInfo[playerid][VDP] = strval(Field);
				db_get_field_assoc(Result, "UBOJSTVA", Field, 30);
				PlayerInfo[playerid][Ubojstva] = strval(Field);
				db_get_field_assoc(Result, "SMRTI", Field, 30);
				PlayerInfo[playerid][Smrti] = strval(Field);
				db_get_field_assoc(Result, "TRAVA", Field, 30);
				PlayerInfo[playerid][Trava] = strval(Field);
                db_get_field_assoc(Result, "DUHAN", Field, 30);
				PlayerInfo[playerid][Duhan] = strval(Field);
				db_get_field_assoc(Result, "RIZLE", Field, 30);
				PlayerInfo[playerid][Rizle] = strval(Field);
				db_get_field_assoc(Result, "KOKAIN", Field, 30);
				PlayerInfo[playerid][Kokain] = strval(Field);
				db_get_field_assoc(Result, "KREDIT", Field, 30);
				PlayerInfo[playerid][Kredit] = strval(Field);
				db_get_field_assoc(Result, "KREDITIZNOS", Field, 30);
				PlayerInfo[playerid][KreditIznos] = strval(Field);
				db_get_field_assoc(Result, "KUCA", Field, 30);
				PlayerInfo[playerid][Kuca] = strval(Field);
				db_get_field_assoc(Result, "FIRMA", Field, 30);
				PlayerInfo[playerid][Firma] = strval(Field);
				db_get_field_assoc(Result, "VOZILO", Field, 30);
				PlayerInfo[playerid][Vozilo] = strval(Field);
				db_get_field_assoc(Result, "MOTOR", Field, 30);
				PlayerInfo[playerid][Motor] = strval(Field);
				db_get_field_assoc(Result, "BICKIKLA", Field, 30);
				PlayerInfo[playerid][Bicikla] = strval(Field);
				db_get_field_assoc(Result, "LETJELICA", Field, 30);
				PlayerInfo[playerid][Letjelica] = strval(Field);
				db_get_field_assoc(Result, "PLOVILO", Field, 30);
				PlayerInfo[playerid][Plovilo] = strval(Field);
				db_get_field_assoc(Result, "VIKENDICA", Field, 30);
				PlayerInfo[playerid][Vikendica] = strval(Field);
				db_get_field_assoc(Result, "KLJUC1", Field, 30);
				PlayerInfo[playerid][Kljuc][0] = strval(Field);
				db_get_field_assoc(Result, "KLJUC2", Field, 30);
				PlayerInfo[playerid][Kljuc][1] = strval(Field);
				db_get_field_assoc(Result, "KLJUC3", Field, 30);
				PlayerInfo[playerid][Kljuc][2] = strval(Field);
				db_get_field_assoc(Result, "UPOZORENJA", Field, 30);
				PlayerInfo[playerid][Upozorenja] = strval(Field);
				db_get_field_assoc(Result, "NAOCALE", Field, 30);
				PlayerInfo[playerid][Naocale] = strval(Field);
				db_get_field_assoc(Result, "MASKA", Field, 30);
				PlayerInfo[playerid][Maska] = strval(Field);
				db_get_field_assoc(Result, "KAPA", Field, 30);
				PlayerInfo[playerid][Kapa] = strval(Field);
				db_get_field_assoc(Result, "SJEME", Field, 30);
				PlayerInfo[playerid][Sjeme] = strval(Field);
				db_get_field_assoc(Result, "MATERIJALI", Field, 30);
				PlayerInfo[playerid][Materijali] = strval(Field);
				db_get_field_assoc(Result, "ORUZJE", Field, 30);
				PlayerInfo[playerid][Oruzije] = strval(Field);
				db_get_field_assoc(Result, "MUNICIJA", Field, 30);
				PlayerInfo[playerid][Municija] = strval(Field);
				db_get_field_assoc(Result, "CARLIC", Field, 30);
				PlayerInfo[playerid][CarLic] = strval(Field);
				db_get_field_assoc(Result, "BOATLIC", Field, 30);
				PlayerInfo[playerid][BoatLic] = strval(Field);
				db_get_field_assoc(Result, "FLYLIC", Field, 30);
				PlayerInfo[playerid][FlyLic] = strval(Field);
				db_get_field_assoc(Result, "TRUCKLIC", Field, 30);
				PlayerInfo[playerid][TruckLic] = strval(Field);
				db_get_field_assoc(Result, "BIKELIC", Field, 30);
				PlayerInfo[playerid][BikeLic] = strval(Field);
				db_get_field_assoc(Result, "KACIGA", Field, 30);
				PlayerInfo[playerid][Kaciga] = strval(Field);
				db_get_field_assoc(Result, "SPAWN", Field, 30);
				PlayerInfo[playerid][Spawn] = strval(Field);
				db_get_field_assoc(Result, "SKIN", Field, 30);
				PlayerInfo[playerid][Skin] = strval(Field);
				db_get_field_assoc(Result, "ZDRAVSTVENO", Field, 30);
				PlayerInfo[playerid][Zdravstveno] = strval(Field);
				db_get_field_assoc(Result, "MEHMATS", Field, 30);
				PlayerInfo[playerid][MehMats] = strval(Field);
                db_get_field_assoc(Result, "BOMBA", Field, 30);
				PlayerInfo[playerid][Bomba] = strval(Field);
				db_get_field_assoc(Result, "BON", Field, 30);
				PlayerInfo[playerid][Bon] = strval(Field);
                Logged[playerid] = true;
                SendClientMessage(playerid, -1, "* "COL_GREEN"Uspjesno ste se"BIJELA" prijavili! ");
				SpawnThisPlayer(playerid);
            }
            else
            {
                format(dialogstring, sizeof(dialogstring), "Dobrodosli na server "SVIJETLOPLAVA"%s"BIJELA", vi ste registrirani\n\nMolimo da se prijavite upisujuci svoju lozinku.", name, playerid);
        		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Prijava", dialogstring, "Login", "Leave");
                SendClientMessage(playerid, -1, ""COL_RED"Kriva"BIJELA" lozinka, pokusajte opet!");
            }
            db_free_result(Result);
        }
        else { SendClientMessage(playerid, -1, "* Otkazali ste! "); Kick(playerid); }
    }
NOTE:On player registration row is flawlessly created with all the default values!
Reply


Messages In This Thread
SQLite help! - by Danijel. - 06.07.2013, 15:28
Re: SQLite help! - by Misiur - 06.07.2013, 16:42
Re: SQLite help! - by Danijel. - 06.07.2013, 16:58
Re: SQLite help! - by Konstantinos - 06.07.2013, 17:11
Re: SQLite help! - by Danijel. - 06.07.2013, 18:01
Re: SQLite help! - by Konstantinos - 06.07.2013, 18:09
Re: SQLite help! - by Danijel. - 06.07.2013, 18:19
Re: SQLite help! - by Konstantinos - 06.07.2013, 19:28
Re: SQLite help! - by Danijel. - 06.07.2013, 20:30
Re: SQLite help! - by Konstantinos - 06.07.2013, 22:08

Forum Jump:


Users browsing this thread: 1 Guest(s)