25.08.2015, 18:03
Quote:
It creates the table perfectly, but it does not create the sql sequence table correctly and it doesn't add registered users I have already erased the whole thing and tried to recreate the register system but I had no luck, I use the same method on other of my work and I have checked everything and it's correct I can't seem to figure out the problem.
|
pawn Код:
new DB: xDB;
main() {
xDB = db_open("TestDB.db");
new Query[303];
strcat(Query, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24), password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL, ", sizeof( Query ));
strcat(Query, "score INTEGER DEFAULT 0 NOT NULL, money INTEGER DEFAULT 1000 NOT NULL, banned INTEGER DEFAULT 0 NOT NULL, ip VARCHAR(16) NOT NULL )", sizeof( Query ));
db_query(xDB, Query);
}
It successfully created TestDB.db in /scriptfiles/ folder with this table in it.
After I've added new record, value in userid behaved like it should, and 1 appeared.
sqlite_sequence also did it's job correctly:
Maybe.. Try with my code and see, if it works for You. If it's not, then I have no idea what's going on, I'm sorry.
Greetings.