07.10.2013, 08:09
Update!
I finally managed to get error messages from db_query!
To use this, you must download amx_assembly (.zip) and put it with your include files.
After that, define DB_QUERY_ERRORS like this:
It might seem like a simple thing, but here's what I had to do to get it working: https://github.com/oscar-broman/sqli...b7fa2d8658b3b1
I finally managed to get error messages from db_query!
pawn Код:
new DB:db = db_open("test.db");
// no such table: some_table
db_query(db, "SELECT * FROM some_table;");
// No error (or "table test already exists" if you run it again)
db_query(db, "CREATE TABLE test (a, b, c)");
// no such column name: name
db_query(db, "SELECT name FROM test");
// near "bla": syntax error
db_query(db, "SELECT test FRMO bla");
db_close(db);
After that, define DB_QUERY_ERRORS like this:
pawn Код:
#define DB_QUERY_ERRORS true
// automatically print errors (it's true by default)
#define DB_PRINT_ERRORS true
#include <sqlitei>