Run MySQL INSERT Query multiple times (insert values into multiple tables)

后端 未结 5 1068
失恋的感觉
失恋的感觉 2021-01-24 05:07

basically, I have 3 tables; users and projects, then I have \'users_projects\' to allow the one-to-many formation. When a user adds a project, I need the project information st

5条回答
  •  [愿得一人]
    2021-01-24 05:23

    $projectid=mysql_insert_id($connection); 
    

    I called this after my first query, this will get the AutoIncrement value from your projects table and store it in $projectid, then the second query will use it. so after execution of my first query, I put the above code there, without changing anything else!!

提交回复
热议问题