0

I am sending a post request from Android to php, everything works fine except if you use ' character in the description field it doesn't work.

I have mysqli_set_charset($conn, 'utf8mb4'); inside the PHP file and the collation of that description row is utf8mb4_bin. Any idea?

mysqli_set_charset($conn, 'utf8mb4');
$description = $_POST["description"];

$sql="INSERT INTO feed (fname,description,gender) VALUES(?,?,?);";

$stmt = $conn->prepare($sql);
$stmt->bind_param("sss", $fname, $description, $gender);
if ($stmt->execute()) {
echo "OK";
} else {
echo "failed";
}

kjmb
  • 35
  • 8

0 Answers0