[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use LAST_INSERT_ID() or mysql_insert_id() ?


>I know this is an old query, but still, problems . . .
>
>I've tried these both, but something is amiss - probably my interpretation.
>
>Every time I try to use LAST_INSERT_ID() I get a complaint that the
>query has a problem.
>
>E.G., $qry=$qry.";select LAST_INSERT_ID();" will blow up on me every
>time  

USE ONE QUERY AT A TIME.  Since last_insert_id() depends on
the connection involved, no query done on a different connection
between your insert and getting last_insert_id() will affect
the result you get.


>I've evaluated $qry, and it works just fine until I append the
>piece that should let me recover the auto increment value that was
>created during the insert process.

One query at a time.

					Gordon L. Burditt

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread115770@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilotco.