数据库错误 PDOException

Database Error PDOException

我使用 CakePHP 3 创建了我的数据库表并像往常一样烘焙,但是当我将浏览器指向某些 link 时,它给我这个错误:

Error: 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 'AS Users__contact person, Users.Phoneno AS Users__Phoneno, Users.email AS `U' at line 1

If you are using SQL keywords as table column names, you can enable identifier quoting for your database connection in config/app.php.

SQL 查询:

SELECT Users.id AS `Users__id`, 
        Users.name AS `Users__name`, 
        Users.address AS `Users__address`, 
        Users.contact person AS `Users__contact person`, 
        Users.Phoneno AS `Users__Phoneno`, 
        Users.email AS `Users__email` 
FROM users Users 
LIMIT 20 OFFSET 0

谢谢大家和@RiggsFolly 很高兴在 SQL

中观察到了这一点

错误来自 space 列中的联系人,而不是 SQL

中的联系人