Monday, April 9, 2018

php - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'range

Lines of sql code:



$uid=$_POST["uid"];
$mobile=$_POST["mobile"];
$service=$_POST["service"];
$exper=$_POST["exper"];

$range=$_POST["range"];
$af=$_POST["a_from"];
$at=$_POST["a_to"];
$min_charge=$_POST["min_charge"];

$statement=mysqli_prepare($con,"INSERT INTO service (uid,mobile,service,exper,range,a_from,a_to,min_charge) VALUES (?,?,?,?,?,?,?,?)");

mysqli_stmt_bind_param($statement,"iisiiiii",$uid,$mobile,$service,$exper,$range,$af,$at,$min_charge);

mysqli_stmt_execute($statement);


$response=array();
$response["success"]=true;

echo mysqli_error($con);
echo json_encode($response);


Everything is ok, and I don't get any syntax error when I write the code (I am using a code editor software. However, when I use it online, I get this error:





You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use
near 'range,a_from,a_to,min_charge) VALUES (?,?,?,?,?,?,?,?)'


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...