473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 9581
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

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

Similar topics

0
by: Irene Mettias | last post by:
Hello, I've just installed perl DBI v1.38 which according to the documentation supports the method last_insert_id(). For some reason the return value I get is undef. Here is my source code :...
1
by: Michal Adamczakk | last post by:
hi, how to implement mysql's last_insert_id() ? i know that seqences and oids are great. the one thing i miss is that they are not session specific. i mean selecting last_value from seqence...
6
by: jim | last post by:
Hi, I have a site with various parts which allow users to enter info via forms which gets entered into various tables in a MySQL db (I'm using ASP, rather than PHP). I have an ecards bit, and...
3
by: Vic Spainhower | last post by:
Hello, I am trying to get the value of the Auto-Incremented key that was assigned using LAST_INSERT_ID(). However, when I execute the following PHP statements after the insert I only get: "value...
1
by: simbarashe | last post by:
I am trying to insert an auto_increment value into multiple tables but its seems to lose its value after the the second insert statement and my code is as follows can any1 please help. The...
3
by: jx2 | last post by:
hi guys i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it...
2
by: WebSnozz | last post by:
I am losing the leading zeros when I get autoincrement IDs from a column with ZEROFILL enabled. I would like to have the leading zeros. I have tried both the php function last_insert_id as well...
2
by: wizardry | last post by:
Hello - I'm recently a newbie to mysql, but have experiance in oracle, mssql, access, etc... Here is my problem, i've created the table needed to test the audit procedures. the data element...
5
Markus
by: Markus | last post by:
The MySQL manual states: I wonder what is considered a 'client'. Is that simply just different connections to the database?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.