I am extremely confused on how to access this data, and get it into MySQL
I have this JSON Data:   

```
{
   "serial_number": "70-b3-d5-1a-00-be",
   "dateTime": "2020-08-14 20:58",
   "passReport": [
      {
         "id": 1,
         "passList": [
            {
               "passType": 1,
               "time": "20:58:38"
            }
         ]
      }
   ]
}

```

I can get **serial\_number** & **dateTime** perfectly fine, however I cannot get **passType** & **time** into my database

Here is my code for injesting:

```
//read the json file contents
$jsondata = file_get_contents('php://input');
//convert json object to php associative array
$data = json_decode($jsondata, true);

//mySQL creds & mySQL database & tables
$servername = "localhost";
$username = "my user";
$password = "my pass";
$dbname = "my db";
$serial_number = $data['serial_number'];
$dateTime = $data['dateTime'];
$id = $data['id'];
$passType = $data['passType'];
$time = $data['time'];

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
  die("Connection failed: " . mysqli_connect_error());
}

//Insert into Database Tables
$sql = "INSERT INTO mytable (serial_number, dateTime, passType, time)
VALUES('$serial_number', '$dateTime', '$passType', '$time')";

if (mysqli_query($conn, $sql)) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}

mysqli_close($conn);

?>

```

I am pretty noobish at PHP, trying to learn! Appreciate any help here. I don't enough knowledge of accessing the data in the array.. Thanks in advance!