since you're using PHP, you can also get this via the php function mysql_insert_id(). directly after your insert, i think another insert would be nearly impossible to get int he middle of these two.
$insert = mysql_query("insert stuff into table");
$last_id = mysql_insert_id($res_link); (resource link is optional).
hth
Jeff
Aleksandar
Bradaric To: "Paul Fine" <[EMAIL
PROTECTED]>
<[EMAIL PROTECTED] cc: [EMAIL PROTECTED]
net> Subject: Re: Best way to get value of
autoincriment after inserting NULL?
12/15/2003 01:13
PM
Please respond to
Aleksandar
Bradaric
Hi,
> I imagine there has to be a better way!
Yes :) Take a look at the LAST_INSERT_ID() function.
Take care,
Aleksandar
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
