472,127 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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 9509
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.