php - How to insert a id of a new row into another linking table? -


I have a table with the aim of adding two other tables with the foreign key (Table 3).
But I do not know how to query a PHP which will get the generated id of new line in Table 2?
(ID of the table that I have stored in a php variable)
I am looking into the smart storage process?

Steps to follow :

    < li> Insert a line in table2 .
  • Find the key generated from table2 and type it in the PHP variable
     - say it in a PHP variable, say Are, $ last_key SELECT LAST_INSERT_ID (); Use the  insert  statement in  $ last_key  for  table3 .    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -