mysql get last auto increment value
Posted
by Mick
on Stack Overflow
See other posts from Stack Overflow
or by Mick
Published on 2010-03-19T21:59:30Z
Indexed on
2010/03/19
22:01 UTC
Read the original article
Hit count: 192
mysql-query
|php5
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id()
but this only work after I have made an entry
Can anyone help please
thanks
© Stack Overflow or respective owner