At 15:30 -0800 1/29/02, laszlo wrote:
>And then you hope that between 'insert' and 'select' nobody else inserted
>another record?
Only for the last method. The first two return client-specific values.
>
>laszlo
>
>Johnny Withers wrote:
>
>> INSERT into the table
>> then SELECT last_insert_id()
>>
>> or when using php
>>
>> query(INSERT QUERY)
>> $last_id=mysql_insert_id()
>>
>> OR
>>
>> INSERT
>> SELECT MAX(id) FROM tablename
>>
>> assuming id is the auto incremnt field.
>>
>> ---------------------
>> Johnny Withers
>> johnny@stripped
>> p. 601.853.0211
>> c. 601.209.4985
>>
>> -----Original Message-----
>> From: Joel Wickard [mailto:jwickard@stripped]
>> Sent: Tuesday, January 29, 2002 7:04 PM
>> To: mysql@stripped
>> Subject: next insert id
>>
>> database,sql,query,table
>>
>> I need to find out what the next value will be in an auto_increment
>> field
>> will be. could someone help me out with the select statement?
>>
>> ---------------------------------------------------------------------
>> 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-thread97914@stripped>
>> To unsubscribe, e-mail
>> <mysql-unsubscribe-johnny=mindbender.net@stripped>
>> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>>
>> ---------------------------------------------------------------------
>> 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-thread97918@stripped>
>> To unsubscribe, e-mail
> <mysql-unsubscribe-lnadai=jnet1.com@stripped>
>> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>---------------------------------------------------------------------
>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-thread97925@stripped>
>To unsubscribe, e-mail <mysql-unsubscribe-paul=snake.net@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php