MySQL question
- Started
- Last post
- 9 Responses
- cosmo0
if you are using phpmyadmin just empty the table and index will be flushed to 0. Or you can use the code unfit listed above.
- UndoUndo0
that's very annoying 50, you can drop the table and start again or
http://dev.mysql.com/doc/refman/…
and a few other resources
- determinedmoth0
Yes. Are you using PHPMyAdmin?
- cereals0
its really annoying, but...
if your code relies on the id being set to 1 i.e. you've hard coded your menu to an id in a database then somethings gone wrong in your code.
ID in a database should be independant and shouldn't really be used for displaying content, just tying content together...
- determinedmoth0
ALTER TABLE `my_table` AUTO_INCREMENT =0
- unfittoprint0
I used to care about the table being autincremented by 'test posts' but not anymore.
see
the unique id is a valuable identifier because, well, it's unique.
It may look strange having a userID of 122 with only one row on that table, but remember that in a site of multiple tables and INNER JOIN queries, wanting your table structure to look 'pretty' may jeopardize how the whole backend functions.
And you'll add/edit/delete a lot of rows in the future, testing or otherwise...
- fifty500
duly noted, unfit, and thanks moth for the command, I'll give that a shot.
cheers guys
- paraselene0
all my databases that moth taught me how to make start at like 90 or summat. i didn't like it at first either, because of the obsessive compulsive disorder an that, but i'm better now.
- UndoUndo0
ha ha para, I also suffer from a bit of OCD, I find it really annoying that they dont start at 1 and are all nicely ordered....even tho it means jack!