Thread: SQLite Helper
View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-11-2018 , 09:13   Re: SQLite Helper
Reply With Quote #7

Quote:
Originally Posted by Ilusion9 View Post
Use the new syntax and the database class which is threaded.

PHP Code:

public void OnPluginStart()
{
    
Database.Connect(SQL_ConnectToDatabase"storage-local");
}

public 
void SQL_ConnectToDatabase(Database db, const char[] errorany data)
{
    
db.Query(SQL_OnFastQuery"CREATE TABLE IF NOT EXISTS ...");
}

public 
void SQL_OnFastQuery(Database dbDBResultSet rs, const char[] errorany data)
{
    if(
rs == null)
    {
        
LogError("(SQL_OnFastQuery) %s"error);
    }

Why threaded? This is sqlite.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline