SQLite ID problem
#1

Okay so when i create new column it writes: ID: 1, when i delete that column and insert new one, it writes ID: 2 WHY? Any solution?? i am using sqlite
Reply
#2

primary key ? auto index id + 1
Reply
#3

nope didn't set it
Reply
#4

Show create table and how you adding id
Reply
#5

Код HTML:
db_query(Database, "CREATE TABLE IF NOT EXISTS `Reports` (`ID`, `Reporter`, `Target`, `Reason`, `Timestamp`)");
Код HTML:
format(Query, sizeof(Query), "INSERT INTO `Reports` (`ID`, `Reporter`, `Target`, `Reason`, `Timestamp`) VALUES('%i', '%s','%s','%s','%s')", db_get_field_int(Result), DB_Escape(GetName(playerid)), DB_Escape(GetName(target)), DB_Escape(reason), DB_Escape(timestamp));
Reply
#6

but where is `ID` INTEGER etc? what is this db_get_field_int(Result) ? format supports escape strings, you dont need DB_Escape anymore, replace '%s' to '%q'
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)