sql 查询中允许单引号

Allow single quote in sql query

我想更新我的 sql table ,但在我的情况下,我得到的错误看起来像这样

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 'ivision '' at line 1

$name = "A'nme";

$this->db->update("users",["name" => $name]);

我的项目基于 Codeigniter

我该如何解决这个问题?

加倍并使用单引号以更好地查看: How to insert a value that contains an apostrophe (single quote)?

$name = 'A''nme';