how to order by with fuel_model
Hello,
I can't understand from the user guide how to order by a specific field with this:
$cheeses = fuel_model('cheeses')
I tried:
$cheeses = fuel_model('cheeses', array('order' => array('cheese_name' =>'asc')));
and this:
$cheeses = fuel_model('cheeses', ['order' => array('cheese_name' =>'asc')]);
I get this error:
Message: explode() expects parameter 2 to be string, array given
I tried this:
$cheeses = fuel_model('cheeses', '', ['order' => array('cheese_name' =>'asc')]);
No ordering is happening
Filename: database/DB_query_builder.php
Can you please help?
Comments
$cheeses = fuel_model('cheeses', array('find' => 'all', 'where' => array('post_date <' => date('Y-m-d H:i:s')), 'order' => 'post_date asc'));