title: get query results from cdbcommand Yii
body: <p>I've been trying to get the results from my query for the past two hours, in my model I have this</p>
  
  <pre><code>public function getQuotes()
          {            
              $data = Yii::app()-&gt;db-&gt;createCommand('Select fromm from city_fare_final');            
              $data-&gt;queryRow();            
              return $data ;
          }
  </code></pre>
  
  <p>in the controller </p>
  
  <pre><code>    public function actionIndex()
  {
      // renders the view file 'protected/views/site/index.php'
      // using the default layout 'protected/views/layouts/main.php'
              $model=new QuoteForm();
  
      if(isset($_POST['QuoteForm']))
      {
                  $model-&gt;attributes=$_POST['QuoteForm'];
  
                  if ($model-&gt;validate())
                  {
                      $priceTable=new CityFareFinal;
                      $priceTable-&gt;fromm=$model-&gt;pickupL;
                      $priceTable-&gt;too=$model-&gt;dropoffL;                    
                      $priceTable-&gt;type_of_car=$model-&gt;type;                        
        this-&gt;render('result',array('model'=&gt;$priceTable))                        
                  }
  
                  }
              else
              {
                  $this-&gt;render('index',array('model'=&gt;$model));                
              }
  }
  </code></pre>
  
  <p>and in the view </p>
  
  <pre><code>    &lt;div id="moduleResult"&gt;                          
          &lt;span&gt;&lt;?php echo $model-&gt;getQuotes() ;?&gt;&lt;------ Here&lt;/span&gt;
      &lt;/div&gt;     
  </code></pre>
  
  <p>but it always give me an error saying "Object of class CDbCommand could not be converted to string ", what can I do to get the results of my query made in the model???</p>
  
  <p>Regards
  Gabriel</p>