Syntax error or access violation: 1055 Expression #8 of SELECT list is not in GROUP BY clause and contains nonaggregated column

前端 未结 5 818
时光说笑
时光说笑 2021-02-13 15:28

i tried the CakePHP 3.x \"Bookmaker Tutorial\" and i followed the instruction step by step. Unfortunately, at the end of the first chapter i get the attached error:



        
5条回答
  •  滥情空心
    2021-02-13 16:04

    Just stumbled on the same problem.
    A simple way to make the tutorial "work" without changing the query could be to reset sql_mode in config/app.php :

    'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
            ...
            'init' => ["SET sql_mode = ''"],
        ],
    

    While this should makes things work, it is probably not recommended in real life cases.

提交回复
热议问题