Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Active Record Advice Queries
  • Hello, I have a question about the Active Record. Here, if I run the code it will work just fine :
     $options = array(
       'select' => array('id', 'user_id', 'title', 'thumb'),
       'where' => array(
         array('genre', '=', $genre)
       ),
       'limit' => 5
     );
     return parent::find('all', $options);
    

    However, this is what I want to do :
     $options = array(
       'select' => array('id', 'user_id', 'title', 'thumb', 'rate/votes as overall'),
       'where' => array(
         array('genre', '=', $genre)
       ),
       'limit' => 5
     );
     return parent::find('all', $options);
    

    I don't know HOW I can run mysql functions with the Active Record. I have tried using the ` (back tick) in multiple areas, but none work because of this :
    $query .= implode(', ', array_unique(array_map($quote_ident, $this->_select)));
    

    The $this->_select array needs to be evaluated before injecting into the query selector PS - DB DOCS!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!