CodeIgniter Forums
Am I blind? no result when order_by 'desc' on feed-view - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Am I blind? no result when order_by 'desc' on feed-view (/showthread.php?tid=31183)



Am I blind? no result when order_by 'desc' on feed-view - El Forum - 06-09-2010

[eluser]Jan_1[/eluser]
the model:
Code:
class Feed_model extends Model
{
function Feed_model()  { parent::Model();  }
function getRecentPosts ()
  {
    $this->db->order_by('id', 'desc');
//    $this->db->where('status', '1');
    $this->db->limit(20);
    return $this->db->get('blog_entry');
  }
}

Im using derek allard's simple feed-example.
I don't get results when I try to order by id or anything else with 'desc'.
Without order_by, or an order_by without second (asc/desc) works fine.
sorry for my bad english - Any Help???


Am I blind? no result when order_by 'desc' on feed-view - El Forum - 06-09-2010

[eluser]danmontgomery[/eluser]
Enable profiler to see the query being run:

Code:
$this->output->enable_profiler();