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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -