RE: [PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Chris Shiflett
--- Chris Kay <[EMAIL PROTECTED]> wrote: > > Something like this perhaps untested > > function insert($query) { > // Connect info > mysql_connect("host","user","pass"); > > // Select DB > mysql_select_db("DBname"); > > // Perform insert > $ind

RE: [PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Chris Kay
.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: 1300 882 221 - -Original Message- From: Daniel Page [mailto:[EMAIL PROTECTED]] Sent: Friday, 14 February 2003 8:18 AM To: [EMAIL PROTECTED] Subject: Re: [PHP]

Re: [PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Daniel Page
Thanks! I stand corrected. I'll check the PHP online manual more often, and for now, I'm off to optimise my database and rewrite a few queries :) Cheers, Daniel "Leif K-Brooks" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > www.php.net/mysql-insert-id > > Daniel Page wr

Re: [PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Leif K-Brooks
www.php.net/mysql-insert-id Daniel Page wrote: Hi, Imagine a table with an auto-increment id number field and a text field for the username. User B (with user name 'johnny') could write to the database a millisecond after user A, with the same username. When user A looks for the last record wri

[PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Daniel Page
Hi, Imagine a table with an auto-increment id number field and a text field for the username. User B (with user name 'johnny') could write to the database a millisecond after user A, with the same username. When user A looks for the last record written by Johnny, A will find the record entered by