[UPHPU] returning MySQL

Grant Shipley gshipley at gmail.com
Tue Feb 22 19:13:11 MST 2005


Someone correct me if I am wrong here but that will only return the
last insert id for that connection.  So if you have some type of
connection pooling or caching system in place, you might not get the
number you are expecting.

--
Grant


On Tue, 22 Feb 2005 16:37:53 -0700, Timothy Humphrey
<timothy.humphrey at gmail.com> wrote:
> 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',
> '$var_3')";
>                $result = $db->query($record);
>                $db->commit();
> ?>
> 
> I would want to create another variable for the auto increment number
> that the database assigned to that new entry.
> 
> Hope that makes since.
> Timothy
> 
> _______________________________________________
> 
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>



More information about the UPHPU mailing list