Jump to content

Recommended Posts

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 on

Table:  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
 

Link to comment
https://forums.phpfreaks.com/topic/280175-form-to-submit-to-database/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.