Re: [PHP] Getting the primary key from a MySQL insert

2004-07-17 Thread zareef ahmed
Hi ! You can user mysql_insert_id() for this purpose. zareef ahmed --- Andrew Wood <[EMAIL PROTECTED]> wrote: > If the primary key in a MySQL DB is an > autoincrementing integer, is > there anyway of automatically getting it back when I > do an insert in > PHP. In other words taking the stat

Re: [PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread Curt Zirzow
* Thus wrote John W. Holmes: > Andrew Wood wrote: > >Thanks. When it says 'the last insert' is that just the last insert my > >PHP script did, or the last insert on the DB as a whole? > > Read the links Daniel just sent out. And take care in reading the part about it returning the 'last insert

Re: [PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread John W. Holmes
Andrew Wood wrote: Thanks. When it says 'the last insert' is that just the last insert my PHP script did, or the last insert on the DB as a whole? Read the links Daniel just sent out. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PH

Re: [PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread Andrew Wood
Thanks. When it says 'the last insert' is that just the last insert my PHP script did, or the last insert on the DB as a whole? On 16 Jul 2004, at 11:40, [EMAIL PROTECTED] wrote: If the primary key in a MySQL DB is an autoincrementing integer, is there anyway of automatically getting it back whe

[PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread Andrew Wood
If the primary key in a MySQL DB is an autoincrementing integer, is there anyway of automatically getting it back when I do an insert in PHP. In other words taking the status returned by mysql_query and extracting the PK of the record we just entered? -- PHP General Mailing List (http://www.ph