Re: [Phplib-users] nextid - how does it work?
Brought to you by:
nhruby,
richardarcher
From: Richard A. <rh...@ju...> - 2003-07-16 23:16:54
|
At 15:02 -0700 16/7/03, Liberty Young wrote: >Why are you inputting primary keys? Few RDBMS don't have the option to >auto-increment your primary key field. I rarely find myself in a >situation where i'm inputing the value for a primary key field. Foreign >keys, yes, but never primary keys!!! If you're inserting a new record, >let your server do that for you. I _know_ MySQL will do that for you But MySQL doesn't make it very easy to work out what the ID of the just-inserted record was. And this mechanism varies from DB to DB. By using next_id() you know ahead of time what the ID is. I use next_id() quite often for this reason. ...R. |