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

$title=$_POST['title'];
$des=$_POST['description'];

$sql2="SELECT * FROM `property_amenities` WHERE `title`='".$title."'";
$rs2=mysqli_query($conn,$sql2);
$chk2=mysqli_num_rows($rs2);
if($chk2>0)
{
		echo '<script>alert("Title is already exist. Try with new Title");</script>';
	 	echo '<script>window.location.href="propertyAmenities.php";</script>';
}
else
{

	$sql="INSERT INTO `property_amenities`(`title`, `description`) VALUES ('".$title."','".$des."')";
			$rs=mysqli_query($conn,$sql);
			if($rs>0)
			{
				echo '<script>window.location.href="propertyAmenities.php";</script>';
			}
			else
			{
				echo '<script>alert("Unable to Save Title");</script>';
	 			echo '<script>window.location.href="packpropertyAmenities.php";</script>';
			}
	
	}

	

?>