I am having error: ( SQLSTATE[42000]: Syntax error or access violation: 1064 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 's a immoderate-immoderate-fine boy' WHERE id='4'' at line 1all )
I am actually trying to modify and save bulk text using the method bellow by looping but the problem is I get above error after process few text. As I found mysql reserved words getting matched while looping on bulk text. How can I modify my method to work on bulk text without mysql reserved word conflict problem. Whats the solution?
Text update method:
public function update_des($id,$des){
try
{
$stmt = $this->conn->prepare("UPDATE products SET des='$des' WHERE id='$id'");
$stmt->execute();
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}