> The problem is...if I delete the third entry (Edicao = 3), the next
> entry inserted should be 3, right?! Well it is not! It is 4.
Well, this may be debated. I suffered a lot from the behaviour
you want to have. I considered it bad design ...
An autoincrement field should not serve for counting or numbering
but for making sure that you have a unique key - no more and no
less - without having to think about it.
If you count on this - that every record will have its own number
no matter what happens - then the number of a deleted record
_must_ be discarded.
Of course, you can live with both implementations if you know
what happens and what you're doing. Lastly, the trouble I had was
nothing else than bad design.
Relying on the unique key, populated other tables with this
foreign key. When the row was deleted, I didn't care about
deleting the dependent rows in the other tables and files
connected with them (pictures). As a result, there was a good
chance that somebody had the wrong picture in their classifieds:
big embarrassment! Took me some time to find out about this
scenario.
Of course, the bad design was that I didn't care about deleting
all dependencies including the files. But otherwise, I wouldn't
have run into problems at all and only wasted disk space which
isn't that much of a value these days.
If you care to look at the manual, you will find explanations
about this change in design. I don't remember the details now,
but I know that I have seen them. Use the search box and you will
find it fast. This explains why the behavior changes with the
versions.
--
Herzlich
Werner Stuerenburg
_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php