Yii 1 ипсользование Active Record в сторонних файлах
<?php header ( "Content-Type: text/html; charset=utf-8" ); ?> <!DOCTYPE html> <html> <head> <?php $yii = dirname ( __FILE__ ) . '/yii_excel/vendor/yiisoft/yii/framework/yii.php' ; require_once ( $yii ); $yiiConfig = require ( __DIR__ . '/yii_excel/protected/config/main.php' ); Yii :: createWebApplication( $yiiConfig ); $criteria = new CDbCriteria ; //Рекурсивно выбираем потомков $connection = Yii :: app() -> db; $sql = " select now() " ; //http://www.yiiframework.com/doc/guide/1.1/ru/database.dao $dataReader = $connection -> createCommand( $sql ) -> queryScalar(); echo '<pre>' ; var_dump ( $dataReader ); $dataReader = $connection -> createCommand( $sql ) -> query(); $rows = $dataReader -> readAll...