How to store order data from shopify webhooks in mysql database using php?

I want to use shopify order webhook to store order data into mysql database. I am beginner in webhooks. Googled many times to find the guidance about how to achieve it.I found this solutions is very close for me.I wrote the php code but I am getting error like thiserror image.I don’t know why I am getting this error and how to resolve it.Please suggest us.

I followed these steps

  1. I created the webhook from shopify admin dashboard
  2. Point the webhook to my own domain
  3. And write the following code in the pointed link
    here is my code

my code is

<?php
$webhook_content = NULL;

 // Get webhook content from the POST
 $webhook = fopen('php://input' , 'rb');
 while (!feof($webhook)) {
 $webhook_content .= fread($webhook, 4096);
 }

 fclose($webhook);

 // Decode Shopify POST
 $webhook_content = json_decode($webhook_content, TRUE);

$servername = "localhost";
$database = "xxxxxxxx_xxxhalis"; 
$username = "xxxxxxxx_xxxhalis";
$password = "***********";
$sql = "mysql:host=$servername;dbname=$database;";

 // Create a new connection to the MySQL database using PDO, $my_Db_Connection is an object
 try { 
  $db = new PDO($sql, $username, $password);
  //echo "<p> DB Connect = Success.</p>";
 } catch (PDOException $error) {
  echo 'Connection error: ' . $error->getMessage();
 }
    $order_num= $webhook_content['name'];
    $order_date = $webhook_content['created_at'];
    $order_mode = "Online";
    $location= $webhook_content['default_address']['province'];
    $cust_name = $webhook_content['billing_address']['name'];
    $address = $webhook_content['default_address']['address1']['address2']['city']['province']['zip'];
    $phone_num = $webhook_content['default_address']['phone'];
    
    $special_note= $webhook_content['note'];
    $total_mrp = $webhook_content['current_subtotal_price'];
    $total_discount= $webhook_content['current_total_discounts'];
    $sub_total = $webhook_content['current_subtotal_price'];
    $delivery_charges = $webhook_content['presentment_money']['amount'];
    
    $totalOrderValues= $webhook_content['total_price'];
    $discount_approval = "NA";
    $invoice_status= "NA";
    $punching_status = "NA";
    $order_source = "Shopify";
    
    $payment_mode= $webhook_content['payment_gateway_names'];
    $payement_status = "Done";
    $payement_recieve_date= $webhook_content['processed_at'];
    $reference_number = $webhook_content['reference'];
    $cash_handover_status = "NA";

$my_Insert_Statement = $my_Db_Connection->prepare("INSERT INTO `customer_order_sab`( `order_num`, `order_datetime`, `modeOfOrder`, `location`, `customer_name`, `address`, `phone_number`, `special_note`, `total_mrp`, `total_discount`, `sub_total`, `delivery_charges`, `totalOrderValues`, `discount_approval`, `invoice_status`, `punching_status`, `order_source`, `payment_mode`, `payement_status`, `payement_recieve_date`, `reference_number`, `cash_handover_status`) VALUES (:order_num, :order_date, :order_mode, :location, :cust_name, :address, :phone_num, :special_note, :total_mrp, :total_discount, :sub_total, :delivery_charges, :totalOrderValues, :discount_approval, :invoice_status, :punching_status, :order_source, :payment_mode, :payement_status, :payement_recieve_date, :reference_number, :cash_handover_status)");

$my_Insert_Statement->bindParam(':order_num', $order_num);
$my_Insert_Statement->bindParam(':order_date', $order_date);
$my_Insert_Statement->bindParam(':order_mode', $order_mode);
$my_Insert_Statement->bindParam(':location', $location);
$my_Insert_Statement->bindParam(':cust_name', $cust_name);
$my_Insert_Statement->bindParam(':address', $address);
$my_Insert_Statement->bindParam(':phone_num', $phone_num);
$my_Insert_Statement->bindParam(':special_note', $special_note);
$my_Insert_Statement->bindParam(':total_mrp', $total_mrp);
$my_Insert_Statement->bindParam(':total_discount', $total_discount);
$my_Insert_Statement->bindParam(':sub_total', $sub_total);
$my_Insert_Statement->bindParam(':delivery_charges', $delivery_charges);
$my_Insert_Statement->bindParam(':totalOrderValues', $totalOrderValues);
$my_Insert_Statement->bindParam(':discount_approval', $discount_approval);
$my_Insert_Statement->bindParam(':invoice_status', $invoice_status);
$my_Insert_Statement->bindParam(':punching_status', $punching_status);
$my_Insert_Statement->bindParam(':order_source', $order_source);
$my_Insert_Statement->bindParam(':payment_mode', $payment_mode);
$my_Insert_Statement->bindParam(':payement_status', $payement_status);
$my_Insert_Statement->bindParam(':payement_recieve_date', $payement_recieve_date);
$my_Insert_Statement->bindParam(':reference_number', $reference_number);
$my_Insert_Statement->bindParam(':cash_handover_status', $cash_handover_status);
if ($my_Insert_Statement->execute()) {
  echo "New record created successfully";
} else {
  echo "Unable to create record";
}



?>