I need to create a PHP order form with 150 lines, each line has multiple fields that need to be captured. On submitting the form, what is the best way to enter this data into the mysql database without repeating code over and over?
I could get the form values for each of the 150 rows using POST, then writing to mysql with:
INSERT INTO example
(example_id, name, value, other_value)
VALUES
(100, 'Name 1', 'Value 1', 'Other 1'),
(101, 'Name 2', 'Value 2', 'Other 2'),
(102, 'Name 3', 'Value 3', 'Other 3'),
(103, 'Name 4', 'Value 4', 'Other 4');
Is there a less cumbersome way of doing this?
The second step I need to do is display each of the entered records and allow the users to edit the product code or qty they want to order. these changes then need to update the order in the database?
any suggestions or guidance on this? With my limited skills I dont want to repeat each section of code 150 times?
Thanks in advance for any guidance you guys can give me.
you can do it by
or you can just create form and when you will working on query so just print_r($_POST) and copy all array and save it on page with php comments just remove “>” sign and another some by finding and replacing, just put it on query.