php - Insert into multiple tables at once -
I am trying to insert data in several tables, but I can not get it to work.
There is a project table and a tag table when I create a new project, I have to go project data into the project table and I post it on the same tag to go to tag template. I have no idea how to do this.
In addition to this, the tag table uses Project_ID from the project table. ID is set with auto increment How can I use ID from the project table in the tag table?
The query I am using to include in the project table:
values ('$ title', '$ summary', '$ content', '$ time' 'Project_pics / $ image_name'););
$ q1 = mysql_query ("Insert in Tab 1"); $ Id = mysql_insert_id (); $ Q2 = mysql_query ("Tab 2 values ('$ Id') "
Comments
Post a Comment