[UPHPU] returning MySQL

Brady Mitchell mydarb at comcast.net
Tue Feb 22 16:57:22 MST 2005

Depending on the DB class you are using, it might have a function for this built in.  I know that
ADODB (http://adodb.sf.net) does.  Otherwise, use the mysql_insert_id() function that Dave


-----Original Message-----
From: uphpu-bounces at uphpu.org [mailto:uphpu-bounces at uphpu.org] On Behalf Of Timothy Humphrey
Sent: Tuesday, February 22, 2005 4:38 PM
To: uphpu at uphpu.org
Subject: [UPHPU] returning MySQL

How would one return the "auto increment" number from a newly created 
record automatically?

For example:
$record = "INSERT INTO database VALUES ('', '$var_1','$var_2', '1', 
		$result = $db->query($record);

I would want to create another variable for the auto increment number 
that the database assigned to that new entry.

Hope that makes since.


UPHPU mailing list
UPHPU at uphpu.org
IRC: #uphpu on irc.freenode.net

More information about the UPHPU mailing list