Re: [Phplib-users] nextid - how does it work?
Brought to you by:
nhruby,
richardarcher
|
From: Liberty Y. <li...@em...> - 2003-07-16 22:07:40
|
I can't answer your question..though i do have a few comments.
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
On Wed, 2003-07-16 at 14:20, Neha Mathur wrote:
> Hello,
>
> I'm trying to use nextid but even after reading the documentation notes on
> it, I'm still quite confused on how to use it.
>
> I have a db_sql instanced and I need to find out the next primary key in
> sequence in a table in my database so I can insert a row with this data as
> such -
>
> $db = new DB_SQL_SubClass(connection params);
> $nextIDinSeq = nextid("???"); \\ i have no clue what goes within the parens
> there
>
> $insertQuery = "insert into xyztable ('Next in Sequence') values
> ($nextIDinSeq)";
> $db->query($insertQuery);
> etc etc...
>
> How do I determine what the nextid is?
>
> Help? Please?
>
> Maya
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
|