Using Active Record Or Query Builder At External File

I want to create a cronjob.php file to my application root folder. It will be executed every 10 minutes, with my server’s cronjob feature.

cronjob.php file will fetch all rows from database, from site table. Should i connect to databse with classic way , with mysql_connect() etc ? How can i use Yii’s Active Record or Query Builder at my cronjob.php file ?

depends what you doing if you doing heavy stuff you rather use query build if its usual stuff use AR


guide might help you take look at the guide