skygremlin Posted July 15, 2013 Share Posted July 15, 2013 I’m trying to design a php form to insert new jobs to a database containing multiple linked tables, not sure whats the best approach. Right now there should only be one person updating the db, but I'd like to take into consideration the possibility that multiple people will at the same time. So far I’ve got: Table: job Col: Primary Key: job_id Col: jobName Col: Location data and so onTable: job_resp Col: Primary Key: jobResp_id Col: Foreign Key: job_id -> job.job_id Col: resp Col: duties Table: job_skills Col: Primary Key: jobSkills_id Col: Foreign Key: job_id -> job.job_id Col: required_skills Col: and so on..Option 1:One form containing all the info -> insert the job to the job table , then immediately run another query that gets the last job_id from the jobs table and put that to a variable.. Then insert all the other data to the respective table using that job_id…Option2:Have 2 separate forms.. insert the job to the job table -> immediately query that table and get the last id for the next form where the user can input all the responsibilities and skills… Or is there an easier way / setup??thanx Quote Link to comment Share on other sites More sharing options...
fastsol Posted July 15, 2013 Share Posted July 15, 2013 Option #1 sounds like a pretty normal method to me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.