Advertisement

06.03.2008 at 11:36AM PDT, ID: 23454162
[x]
Attachment Details

How would I retrieve the ID of a record just created on an insert?

Asked by richardsimnett in MySQL

Hello,
Im submitting data to a table called reviews, after the new review is submitted i need to retrieve the rows id number can I do it in the same SQL statement (like in SQL Servers select identity() as id)?

Here is the insert

    insert into reviews
    (sku,author,title,stars,review,datesubmitted,active)
    VALUES(${param.sku},'${param.name}','${param.title}',${param.stars},'${param.review}',CURDATE(),0);
   

Thanks,
RickStart Free Trial
[+][-]06.03.2008 at 11:47AM PDT, ID: 21703251

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.03.2008 at 11:48AM PDT, ID: 21703272

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.03.2008 at 11:53AM PDT, ID: 21703323

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL
Sign Up Now!
Solution Provided By: leannonn
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.03.2008 at 11:58AM PDT, ID: 21703363

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628