GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/uploads/saveNewPincode.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');

$newpin=$_GET['newpin'];
$pin_status=$_GET['pin_status'];

// check pincode is avail o not
$sql="SELECT * FROM `manage_pincode` WHERE `pincode`='".$newpin."'";
$rs=mysqli_query($conn,$sql);
$check=mysqli_num_rows($rs);
if($check>0){
	echo "2";
}
else
{
	// save new pincode
	$sql2="INSERT INTO `manage_pincode`(`pincode`, `delivery_avilability`) VALUES ('".$newpin."','".$pin_status."')";
	$rs2=mysqli_query($conn,$sql2);
	if($rs2>0){
		echo "1";
	}
	else
	{
		echo "0";
	}
}

?>