Originally posted by g7pwx
Hi all.
Ok i got a database with say 2000 entries. Each of these entries has an id_num which auto increments everytime you enter data.
sometimes certain entries are deleted and I need to know is there anyway to find out what id_num's are missing. How would i achieve this or is it achievable?
if you want me to clarify please let me know
Thanks for any help.
Stop right there. The reason for autoincrementing id fields is NOT to provide you with a nice sequential list of all your records. It is to provide a unique identifier. If the number were assigned in a pseudo random order (1,56,34987,3485734,2,458, etc...) it would still be just as useful for it's intended purpose.
This unique identifier can then be used to link data in other tables to the master table. Renumbering this field would result in records in the surbordinate fields pointing to the wrong parent record. What you want are row numbers, and those are better provided some other way, either via PHP during delivery, or a secondary field you run some kind of update on every now and then. Renumber an auto-inc is a cardinal sin of database design, and should be avoided. period. honestly.