If I have two different MySQL insert functions in a document going to two different tables, how can I get the id of one record and place it in the other table?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can get the last insert id by mysql_insert_id() function and then use it.
For example your first Insert query is
Your second Query will be