Tuesday, 6 March 2018

php - Return newly inserted index value

I have two tables Production and Production_Detail. Production_Detail holds details of some order and has a foreign key to Production. When I insert a row into Production, auto-incrementing column sets the key for that row. I need that key so that it can be linked with the new Production_Detail rows that will be inserted after inserting the master row in Production.


Using php, I insert the data:


insert into Production Values ('','$producer_id','$order_date','$company_id','$emp_id');

I need to find that '' part so that it can be used for later quires.

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...