mardi 14 avril 2015

How do I pass multi-dimensional arrays through a form in PHP?

I've created a table where the user can add both columns and rows, so both of these are unknown lengths. All the fields for these contain input boxes for the user to enter data. (ignore the x's, they're links to related pages). Table


PHP for the table (line 46 is where I'm passing the array)


I've decided the best way to pass these for input into a mysql database is through a multi-dimensional array. I've heard I can do so, but I can't find any related documentation for the life of me.


When the user clicks submit, all the data should be inputted into a table like so:

(where header = cem_param_id and product (left side) = cem_prod_id) Database


How do I go about doing this?


I am aware MySQL is outdated. I'm still learning to update it.


Aucun commentaire:

Enregistrer un commentaire