Ask a Question related to ASP, Design and Development.
-
Richard N. #1
mySQL / Last inserted record ID
Hi,
I'm using mySQL and wanted to get the ID of the record that I have just
inserted in to the table (sentmessages). There is a function in mySQL that
appears to be able to perform this task but I am not having any luck in
getting it to work.
Anybody else tried, successfully or not, to use this ?
The function is called LAST_INSERT_ID() and I have tried to implement it as
follows :
strLastID = objConn.Execute("SELECT LAST_INSERT_ID() FROM sentmessages")
Thanks
Richard
Richard N. Guest
-
Inserting a timestamp when record is inserted
Hi, how would I have a form insert a timestamp when the form was submitted for update into a table. I know there is a timestamp column type but I... -
ID of last record inserted
Is it possible, with a MS Access database, to pull the ID of a record just inserted? I have found various threads and tutorials on various sites... -
Accepted way to grab the ID of a record you have just inserted?
I have a page that inserts a new record into a DB. Upon doing so, I want to refresh the page and return the data that was just entered (including... -
Identity from inserted record
I'm inserting a record into a SQL Server database. Once the record has been added, I need the Identity value that SQL Server created. Normally, the... -
returning an inserted SQL record
Found my answer... Select max(column) as ID from table -
Peter Foti #2
Re: mySQL / Last inserted record ID
"Richard N." <richard@NOSPAMPLEASEbrandlink.co.uk> wrote in message
news:bn11n5$lk6$1@hercules.btinternet.com...as> Hi,
>
> I'm using mySQL and wanted to get the ID of the record that I have just
> inserted in to the table (sentmessages). There is a function in mySQL that
> appears to be able to perform this task but I am not having any luck in
> getting it to work.
>
> Anybody else tried, successfully or not, to use this ?
>
> The function is called LAST_INSERT_ID() and I have tried to implement itSQL Server has @@IDENTITY> follows :
>
> strLastID = objConn.Execute("SELECT LAST_INSERT_ID() FROM sentmessages")
[url]http://www.kamath.com/tutorials/tut007_identity.asp[/url]
But I don't know if mySQL supports that. Search the manual for IDENTITY. I
think there is some form of this, but I'm not sure what exactly it looks
like.
HTH.
Peter Foti
Peter Foti Guest
-
Richard N. #3
Re: mySQL / Last inserted record ID
<snip>
I>> > strLastID = objConn.Execute("SELECT LAST_INSERT_ID() FROM sentmessages")
> SQL Server has @@IDENTITY
> [url]http://www.kamath.com/tutorials/tut007_identity.asp[/url]
>
> But I don't know if mySQL supports that. Search the manual for IDENTITY.So does mySQL apparently ! Works great thanks.......> think there is some form of this, but I'm not sure what exactly it looks
> like.
>
> HTH.
> Peter Foti
>
Richard
Richard N. Guest



Reply With Quote

