SQLite won't create database
#2

pawn Код:
format(Query, sizeof(Query), "SELECT 'password' FROM 'users' WHERE 'username' = '%s' LIMIT 0, 1", DB_Escape(GetName(playerid)));
    Result = db_query(Database, Query);
    if(db_num_rows(Result))
    {
        db_get_field_assoc(Result, "ip", User[playerid][IP], 16);
        db_get_field_assoc(Result, "password", User[playerid][Password], 129);
        if((!strcmp(iP[playerid], User[playerid][IP], true)))
        {
            LoginPlayer(playerid);
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,
            "xPS : Login", ""white"Welcome back to "#SERVER_NAME"\nYou cannot play the game if you don't login, Here's some several reasons:\n"red"• "white"Your stats will not save\n"red"• "white"To avoid ban evade!\n\n"red"NOTE: "white"If this is not your account, Please left the server and use another username!\n\nPlease input your account's password!", "Login", "");
        }
    }
Selecting only password and then trying to get data (ip and password fields). That's an incorrect way.

Also make sure that the query's lenght is enough in OnPlayerDisconnect.
Reply


Messages In This Thread
SQLite won't create database - by JaKe Elite - 29.09.2013, 11:24
Re: SQLite won't create database - by Konstantinos - 29.09.2013, 11:29
Re: SQLite won't create database - by JaKe Elite - 29.09.2013, 11:37
Re: SQLite won't create database - by Konstantinos - 29.09.2013, 11:41
Re: SQLite won't create database - by JaKe Elite - 29.09.2013, 11:52

Forum Jump:


Users browsing this thread: 2 Guest(s)