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
[EMAIL PROTECTED]
p. 601.853.0211
c. 601.209.4985 

-----Original Message-----
From: Joel Wickard [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 29, 2002 7:04 PM
To: [EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to