[PHP-DB] get row id back on INSERT?

2002-08-01 Thread Michael Zornek

Ok, 

So I'm creating the usually MySQL backend

I have a page that I want to create a new record with some name, then I'd
like to capture the new records id (which is an auto-increment int field) so
I can pass it to the edit.php?id=$theId URL

I could run a reach for the newly inserted row by name .. but that's not
guaranteed to be unique. Maybe name search .. SORT by creation time ? (but
how?)

Any way to do this?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] get row id back on INSERT?

2002-08-01 Thread Jason Wong

On Friday 02 August 2002 03:27, Michael Zornek wrote:
 Ok,

 So I'm creating the usually MySQL backend

 I have a page that I want to create a new record with some name, then I'd
 like to capture the new records id (which is an auto-increment int field)
 so I can pass it to the edit.php?id=$theId URL

 I could run a reach for the newly inserted row by name .. but that's not
 guaranteed to be unique. Maybe name search .. SORT by creation time ? (but
 how?)

 Any way to do this?

rtfm ? mysql_insert_id()

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
All the troubles you have will pass away very quickly.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php