php - Laravel - Group By error on query that works on phpmyadmin with results -


the query is:

$last_topics = topics::orderby('date', 'desc')->groupby('section')->get(); 

and error:

enter image description here

so on error can see query is: select * fromtopicsgroup bysectionorder bydatedesc

but can see same query in phpmyadmin works great, , have result enter image description here

so what's wrong?

i addition can without groupby in query inside laravel doesn't alert error, like: $last_topics = topics::orderby('date', 'desc')->get();

but said in phpmyadmin same query groupby works great

ok mode in database being used within database config /config/database.php. laravel not adding columns group by.

'connections' => [         'mysql' => [             // work             'strict' => false,              // wont work             'strict' => true,         ]     ] 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -