A've already rewrite some application from CakePHP 2 to CakePHP 3. I have some structure in database with column: key (autogenerated key-string). In mysql key is a keyword, so when I write an SQL Query I have to escape it as
INSERT INTO table (`key`) VALUES (....)
Unfortunately when I try to save Entity I receive an error:
[42000][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 'key,
That error is triggered in Cake\ORM\Table in _insert() method on that place:
$statement = $this->query()->insert(array_keys($data))
->values($data)
->execute();
Any suggestions how to avoid that situation? CakePHP version 3.5.11
quoteIdentifiers
param in Database configuration. It should be set totrue
. – Trimetrogon