17.01.2012, 12:03
Hi, i have a small question about INTEGER PRIMARY KEY AUTOINCREMENT in SQLite.
So first step:
I make a simple database:
Ok, i make 3 accounts ... in database will be show like this:
Now i don't know how to do. When a player delete his account with "Key" 1 , account name "Edvin", the rest of account to move on -1 "Key", and in database will show something like this:
To don't stay in this position, after i delete an account:
... ?
So first step:
I make a simple database:
Code:
db_query( Database, "CREATE TABLE IF NOT EXISTS `Database` ( `Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT, `Numbers` NUMERIC )" );
Code:
Key | Name | Numbers | 1 | Edvin | 1022 | 2 | Edvin2 | 1010 | 3 | Edvin3 | 9000 |
Code:
Key | Name | Numbers | 1 | Edvin2 | 1010 | 2 | Edvin3 | 9000 |
Code:
Key | Name | Numbers | 2 | Edvin2 | 1010 | 3 | Edvin3 | 9000 |