I am working on a php project where I have a user and has to undertake a risk assessment – they have to give the hazard type and give it a value of severity and likelihood for all hazards. I want to then record this in the database as separate rows.
The columns in database table looks like
hazard_id, hazard_type, severity, likelihood
The form fields would look like:
hazard type (text field), severity (drop-down) and likelihood (drop-down)
So I would have say 13 repeated lines of the above down the page – all with the same name?
or would you have hazard_type1, hazard_type2 etc
Then I want to post the values to the database so that each hazard shows as different row in the database.
If anyone can help that would be great.
Thanks.
You can use arrays you just have to name your input fields properly
will be visible as
In your case I would use
then in PHP you can use