Re: [Bulk] [PHP] Inserting rows with missing IDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andre Polykanine wrote:
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
195. How do I make the check that allows to insert firstly the missing
IDs and only then apply the auto-increment?
Thanks
Almost certainly you should not want to.

The ID should simply be unique, and have no inherent meaning.

Why do you care if there are gaps?

But if you must, just select the IDs, put them in an array, and query the elements.

Stephen

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux