Tuesday, March 6, 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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...