Hi,
First let me explain I will be fetching a lot of records from tables, I will not be using ARecord as I wont’ be updating or deleting data for now. So I think I will using CDbCommand or CDbCommandBuilder to fetch the data. This is right?
I’ve looked at the CDbCommand and I’ve managed to get the results with the following code:
$connection = Yii::app()->db;
$sql = "SELECT * FROM Hotels LIMIT 10";
$command = $connection->createCommand($sql);
$data = $command->query();
$this->render('index', $data);
But I will be doing some complex queries with sorting and criteria, should I use CDbCommand or CDbCommandBuilder?
I can’t seem to find much information about the CDbCommandBuilder, is there any good place to see this documentation?
Sorry if all the questions are so noob.
Thanks