469,322 Members | 1,593 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

how to use LAST_INSERT_ID( )

seshu
156 100+
thank sir
now one more dubt how to use last_insert_id( )
because i want get all the last inserted and then update only those values
can you say me how?
regards
seshu
Jan 17 '07 #1
1 9425
ronverdonk
4,258 Expert 4TB
thank sir
now one more dubt how to use last_insert_id( )
because i want get all the last inserted and then update only those values
can you say me how?
regards
seshu
Be careful by what you mean by "all the last inserted"!
There is only one last inserted and you will get that id only after an INSERT or an UPDATE command. As the manual states:
LAST_INSERT_ID() (with no argument) returns the first automatically generated value that was set for an AUTO_INCREMENT column by the most recently executed INSERT or UPDATE statement to affect such a column.
See also the MySQL documentation about usage at Information functions

Ronald :cool:
Jan 17 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Irene Mettias | last post: by
1 post views Thread by Michal Adamczakk | last post: by
6 posts views Thread by jim | last post: by
3 posts views Thread by Vic Spainhower | last post: by
3 posts views Thread by jx2 | last post: by
2 posts views Thread by WebSnozz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.