Learn PHP in 17 Days

Easy, non-nonsense guides to learning php. 47 lessons in total - click to get your copy of these fantastic guides.

Reseed MySQL Primary Key - AUTO_INCREMENT

If you want to reseed your primary key (i.e. change the value of the next primary key generated), use this handy MySQL function:

ALTER TABLE table_name AUTO_INCREMENT = 59446; This is useful for when you are starting a new site and you want to disguise that fact. For example, if you sign up a new user and their user_id is 14 it is a giveaway that there are only a maximum of 13 other users.

Are you a Developer, Designer or Copy Writer? Or Looking For One?

Click here to see 100s of jobs updated every day that you can complete to earn good money. Also find that programmer, designer or copy writer you have been looking for - advertise and get the best guy for your job - click here to find out more

2 Comments so far

  1. ebe on September 10th, 2007

    Yeh, but the most of the readers are using phpMyAdmin.. and they could just click “Operations” -tab .. and set the AUTO_INCREMENT -value.

  2. Carey on September 10th, 2007

    Good advice, I am personally not a fan of phpMyAdmin. Much prefer to do as much as I can in sql.

Leave a Reply

Make $100,000/Month - Every Month!

It Works! We Make Our Customers Millionaires! Act now and get $600 bonus and a Free Money Making Website! - click to get started