Insert Mysql with PHP - problem with foreign key insert

carpinteyroklx

New Member
\[code\][project_select]UserID (fk) | project_id (fk) | project_category_id (fk)[project_category]project_category_id | category[projects]project_id | projectname[project_user]UserID | Name\[/code\]How can I insert Data with php in the tables project_category, projects and project_user, to get automatically the values in the project_select table with the FK's?Update:How can I merge this 3 queries into one line?\[code\]INSERT INTO project_categoryVALUES (1,'Fruits')INSERT INTO projectsVALUES (4,'Apple')INSERT INTO project_userVALUES (2,'Adam')\[/code\]and get this values with this one query in the project_select table:\[code\][project_select]UserID (fk) | project_id (fk) | project_category_id (fk) 2 4 1\[/code\]
 
Back
Top