I am experiencing an issue with this error, The code I have used is given below:
<?php
$cus_name = isset($_POST['client_name'])?$_POST['client_name']:'';
$description = isset($_POST['desc'])?$_POST['desc']:'';
$amount = isset($_POST['amnt'])?$_POST['amnt']:'';
$query = "INSERT INTO ".$RECORD_TABLE."(cus_name,description,amount) VALUES ('$cus_name','$description','$amount') " ;
$result = mysqli_query($dbObj,$query);
if(!$result)
{
echo "error while inserting";
}
?>
That is the code I am using for insertion of date into the database. The connection code I am giving below:
$DB_HOST = 'localhost';
$DB_USER = 'root';
$DB_PWD = '';
$DB_NAME = 'hotel_booking';
$BOOKING_TABLE = 'hotel_booking';
$PRICING_TABLE = 'hotel_pricing';
$SETTING_TABLE = 'hotel_setting';
$RECORD_TABLE = 'hotel_record';
require_once('Database.class.php');
global $dbObj;
$dbObj = new Database($DB_HOST,$DB_USER,$DB_PWD,$DB_NAME,1,0);