<?php

$name=$_POST['name'];


$order_date=$_POST['order_date'];

$due_date=$_POST['due_date'];
$po_no=$_POST['po_no'];
require_once "config.php";

$sql="select * from production_details where po_no='".$po_no."' and order_date='".$order_date."' and customer_name='".$name."' and status='pending'";
$query=mysqli_query($con,$sql);
if($result=mysqli_fetch_array($query)){
    die("Customer and order date exists");
}


$sql="insert into production_details(po_no,customer_name,order_date,due_date) values('".$po_no."','".$name."','".$order_date."','".$due_date."')";
$query=mysqli_query($con,$sql);
$count=mysqli_affected_rows($con);


if($query==false){
    die(mysqli_error($con));
}
echo $count;


?>