I have a form where users can save text to a mysql database. I'm using a prepared statement to insert the data but I can't understand why I am unable to insert any text that has a comma. When I retrieve the $detail
string it echoe's out but ends as soon as it hits a comma. What am I missing? Thanks.
Example: I want to insert this statement, ok.
Prints out: I want to insert this statement
My code (simplified)
$detail=htmlentities($_POST["detail"], ENT_QUOTES);
$id=$_POST["id"];
$stmt = $db_conx->prepare('UPDATE tbl_uploads SET detail=? WHERE id=?');
$stmt->bind_param('ss',$detail,$id);
$stmt->execute();
if ($stmt->execute()) { //true
echo'success';
}else{
echo "error";
}