I want to make mysql query to get the highest 5 values in a column from a table, so the query is :
'SELECT * FROM files ORDER BY `uploadDate` DESC LIMIT 5'
how to run this query and save its value in a variable?
I prefer to use findAll() method with these options if it is possible.
There are several ways to achieve this, but if you prefer the query builder way
Read this documentation for more detail : http://www.yiiframework.com/doc/guide/1.1/en/database.query-builder