13.04.2015, 08:38
Hi Hybris,
I used the wiki to get this result (links https://sampwiki.blast.hk/wiki/Db_query https://sampwiki.blast.hk/wiki/Db_free_result).
Try using this code. You may need to replace db_handle with your database handle which should have been defined when you used db_open.
I would also suggest you read over the wiki for db_query. Please see following extract from the wiki.
db_query(DB:db, query[]);
DB:db The database handle to query.
query[] The query to execute.
I don't think your DB:db (database to handle query) is correct and should not be szQuery. The correct DB:db to use would be where you used:
db_handle = db_open("example.db")
So your db_query should look like this:
db_query(db_handle, szQuery);
I used the wiki to get this result (links https://sampwiki.blast.hk/wiki/Db_query https://sampwiki.blast.hk/wiki/Db_free_result).
Try using this code. You may need to replace db_handle with your database handle which should have been defined when you used db_open.
Код:
format(szQuery, sizeof(szQuery), "DELETE FROM bans WHERE name = '%s'", DB_Escape(params)); db_result = db_query(db_handle, szQuery); db_free_result(db_result);
db_query(DB:db, query[]);
DB:db The database handle to query.
query[] The query to execute.
I don't think your DB:db (database to handle query) is correct and should not be szQuery. The correct DB:db to use would be where you used:
db_handle = db_open("example.db")
So your db_query should look like this:
db_query(db_handle, szQuery);