Answer the question
In order to leave comments, you need to log in
How to properly handle single quote in SQL query via PDO?
Hello, I have a situation that is not clear to me.
Data is saved via
$sth = $this->db->prepare($sql);
$result = $sth->execute($params);
Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 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 '[email protected]'' at line 1 in ...\application\model\M_Database.php on line 49
':email' => string(18) "a'[email protected]"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question