SQLite not creating sql_sequence properly
#4

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
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.
Well, I've tried tried to run this one:
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 appears, that in SQLite it is AUTOINCREMENT, without underscore below it.. My bad..

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.


Reply


Messages In This Thread
SQLite not creating sql_sequence properly - by DarkLored - 25.08.2015, 17:22
Re: SQLite not creating sql_sequence properly - by LetsOWN[PL] - 25.08.2015, 17:40
Re: SQLite not creating sql_sequence properly - by DarkLored - 25.08.2015, 17:44
Re: SQLite not creating sql_sequence properly - by LetsOWN[PL] - 25.08.2015, 18:03
Re: SQLite not creating sql_sequence properly - by DarkLored - 25.08.2015, 23:29
Re: SQLite not creating sql_sequence properly - by DarkLored - 26.08.2015, 04:21
Re: SQLite not creating sql_sequence properly - by LetsOWN[PL] - 26.08.2015, 08:52
Re: SQLite not creating sql_sequence properly - by DarkLored - 26.08.2015, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)