<?php

    $owner_name = $_POST["owner_name"];
    $mobile = $_POST["mobile"];
    $shop_name = $_POST["shop_name"];
    $place = $_POST["place"];
    $pincode = $_POST["pincode"];
    $category = $_POST["category"];
    $address_line1 = $_POST["address_line1"];
    $landmark = $_POST["landmark"];
    $district = $_POST["district"];
    $state = $_POST["state"];
    $date = date("Y-m-d");

    //include 'common/connection.php';
    $servername = "localhost";
    $username = "finstech_sales";
    $password = "SalesApp@123";
    $dbname = "finstech_salesapp";

    try {
      $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
      $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $sql = "insert into master_shop (owner_name,mobile,shop_name,place,pincode,category,address_line1,address_line2,address_line3,state,added_on) 
                values('$owner_name','$mobile','$shop_name','$place',$pincode,'$category','$address_line1','$landmark','$district','$state','$date')";
      $conn->exec($sql);
      echo "Success";
    } catch(PDOException $e) {
      echo $sql . "<br>" . $e->getMessage();
    }
    $conn = null;
    
?>