Re: DB class, MySQL and nextId()
| From: | Lukas Smith | Date: | Fri, 16 Apr 2004 00:44:28 +0000 |
| Subject: | Re: DB class, MySQL and nextId() | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11896@lists.php.net to get a copy of this message | ||
I suggest you all make up your minds.
Do you want abstraction or not?
If you dont want abstraction simply select the last value from the table:
SELECT LAST_INSERT_ID()
If you want abstraction then I guess you will just have to trust that we know what we are doing. I am not aware that Java even bothers to abstract this sort of thing .. anyways I dont see where we are to blame for this fact.
Finally it should be trivial to write a little migration script that runs through your database finds all auto_increment fields, does a MAX() and them an creates the necessary sequences.
If I sound a bit miffed it might be a result of the fact that none of you have bothered to search the archives or have tried to keep a polite tone in your questions.
regards,
Lukas