How can I reset the ID in the database back to 1? Because when I add another info for example, in the database, there is an ID and a Name The ID was auto incremented so after adding 1, and a name sample: Apple, i'll add another name, for example Orange, and the ID auto increments to 2, and so on... i want to delete the 2 entries, then add another 1, but it starts now to 3... 3 Banana then add another 1, then it add another number, so the ID is now 4... even if i refresh and delete cookies, it continues to increment... my question is, how can i reset it back to 0? so that when I add a new entry, it starts again to 1? need help im so nooob at this stuff T__T
First this is a mysql question and not really a php question. If the table has data in it already then it will not keep the # setting even if you chnage it. Because mysql will see the next id number from the previous auto_inc number. You can in phpMyAdmin 'empty' the table and it will reset the auto number, but that will leave you with a blank table. The other is to goto the options page and set the number there, but on the next auto_increment will go to what ever the next # is. If you don't have indexed pages that use the id's for anything. I would recommend you remove all the id entry's and then readd them. That way they reorder themself and you end up with a lower next number if you have removed entry's.
wow thanks for all the very informative replies.. hehe.. i can't find a mysql forums, that's why i posted it here.. hihihi.. thanks ^__^