Advice about saving HTML table data using JSON

I need to pass data from an HTML table to a PHP script to save the data to a MySQL table. The table will contain between 10 and 25 rows.

I am using Javascript (not Jquery) to parse the table, and, for each table row, I get 5 variables:
id, text string, and 3 dates (or nulls)

I have never used it, but assume that JSON would be the way to go. However all the examples I have found relate to an array of variables for a single record.

In addition there are 2 other variables that need to be passed, but I reckon these could be passed as variables

The JSON array produced by the codek:

[
{ "id" : 128, "var" : "1100010010" , "passdate" : " " , "awarddate" : ""},
{ "id" : 228, "var" : "1100010010" , "passdate" : " " , "awarddate" : ""},
{ "id" : 324, "var" : "1111110101" , "passdate" : "17/09/2023" , "awarddate" : "24/09/2023"}
]

If I am wrong please correct me!

I need help inunderstanding how to send such data to the PHP file, and the basic way the sent data can be extracted in the PHP file.

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service