Possible Duplicate:
MySQL: Reorder/Reset auto increment primary key?
I've created a file called register.php
which logs each user's User ID. My partner has created his own version. Inside our databases, I am User ID 1 by default, and he is User ID 2. We both have 4 additional users. The issue I'm having is that I deleted all users from my database, but whenever a new member registers to my site, their User ID is either 7 and up - instead of 2 (which is right after mine). Can anybody help me to solve this?
My shortened Database:
CREATE TABLE `users` (
`user_id` int(100) not null auto_increment,
`user_name` varchar(50) not null,
`user_pass` varchar(100) not null,
`user_email` varchar(255) not null,
PRIMARY KEY (`user_id`),
UNIQUE KEY (`user_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8_unicode_ci AUTO_INCREMENT=8;
Now here is the Sql:
$sql = "INSERT INTO
users(user_name, user_pass, user_email , user_date , user_level)
VALUES('" . mysql_real_escape_string($_POST['user_name']) . "',
'" . $ip . "',
'" . sha1($_POST['user_pass']) . "',
'" . mysql_real_escape_string($_POST['user_email']) . "',
NOW(),
0)";