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 .
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
Post a Comment