Jump to content

Form to submit to database


skygremlin

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.