# Advice about saving HTML table data using JSON

**URL:** <https://www.phphelp.com/t/advice-about-saving-html-table-data-using-json/35804>\
**Category:** Javascript & Ajax\
**Created:** [November 5, 2023, 9:50pm UTC](https://www.phphelp.com/t/advice-about-saving-html-table-data-using-json/35804 "2023-11-05T21:50:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waspman](https://www.phphelp.com/letter_avatar_proxy/v4/letter/w/db5fbb/32.png) [@Waspman](https://www.phphelp.com/u/Waspman)\
**Post date:** [November 5, 2023, 9:50pm UTC](https://www.phphelp.com/t/advice-about-saving-html-table-data-using-json/35804/1 "2023-11-05T21:50:35Z")

</div>

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:

```auto
[
{ "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
