Currently I am having problem running my code in live server even though i can run it in my localhost.
if($con->connect_error){
$response['success'] =0;
$response['message'] ='could not connect to database';
print(json_encode($response));
die(print(json_encode($response)));
}
$response['success'] =1;
$response['message'] ='successfully connected to the database';
print(json_encode($response));
$depart = $_GET['depart'];
$destination = $_GET['destination'];
$sql = "INSERT INTO request (dateNtime, depart, destination, status) VALUES (now(),$depart,$destination,0)";
$mysql=mysqli_query($con,$sql);
if($mysql)
{
echo "successfully";
}
else
{
echo mysqli_error($con);
}
mysqli_close($con);
Currently this is the error I am getting running this code in live server:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'users\',0)' at line 1
May I know what is the cause of this error?