I tried to so hard to find a solution for this but in vain. I could insert into the db successfully all the data, but still I get the same problem.
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 '1' at line 1
I did escape my variables, added ticks ` to the table, but still the same problem.
$insert = $db->query("INSERT INTO `uploadusers` (uploadusers.uname, uploadusers.phone, uploadusers.mail, uploadusers.lng, uploadusers.path) VALUES ('" . mysqli_real_escape_string($db, $userName) . "', '" . mysqli_real_escape_string($db, $userPhone)."', '" . mysqli_real_escape_string($db, $userMail)."', '" . mysqli_real_escape_string($db, $userLng)."', '" . mysqli_real_escape_string($db, $path)."')");
if ($db->query($insert)) {
echo "New record created successfully";
} else {
echo "Error: " . $insert . "<br>" . $db->error;
}
When I echo $insert
gives me '1' and $db->error
gives me that error.