Some Questions [SQLite]
#1

Hello guys i have some question about SQLite :

Can you please explain this part :
pawn Код:
public OnFilterScriptExit()
{
    for(new i; i != MAX_PLAYERS; i++) OnPlayerDisconnect(i, 1);
    db_close(Database);
    return 1;
}
I am new to scripting i just want to know why are you looping ? Why don't you just use :
pawn Код:
db_close(Database);
And also Do i need the DB_Escape stock :
pawn Код:
stock DB_Escape(text[])
{
    new
        ret[80 * 2],
        ch,
        i,
        j;
    while ((ch = text[i++]) && j < sizeof (ret))
    {
        if (ch == '\'')
        {
            if (j < sizeof (ret) - 2)
            {
                ret[j++] = '\'';
                ret[j++] = '\'';
            }
        }
        else if (j < sizeof (ret))
        {
            ret[j++] = ch;
        }
        else
        {
            j++;
        }
    }
    ret[sizeof (ret) - 1] = '\0';
    return ret;
}
Because i made the system without using that ^ stock it worked fine.


Thanks in advance.
Reply


Messages In This Thread
Some Questions [SQLite] - by Glint - 12.09.2012, 06:53
Re: Some Questions [SQLite] - by Guitar - 12.09.2012, 06:54
Re: Some Questions [SQLite] - by [HiC]TheKiller - 12.09.2012, 07:01
Re: Some Questions [SQLite] - by Lorenc_ - 12.09.2012, 07:01
Re: Some Questions [SQLite] - by Glint - 12.09.2012, 07:07

Forum Jump:


Users browsing this thread: 1 Guest(s)