• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ordering DB results by date

#8
[eluser]patrick-vibes[/eluser]
Working now - using the code below. Realised that you define the sorting first, then I am calling the results into a data declaration and passing through to the view.
Code:
<?php

    class Blog extends Controller {
        
        function Blog()
        {
            parent::Controller();
            
            $this->load->scaffolding('portfolio');
            $this->load->helper('url');
        }
        
        function index()
        {
            $data['title'] = "Portfolio Vibes";
            $data['heading'] = "Recent Vibes";
            
            $this->db->orderby("date", "ASC");
            $data['query'] = $this->db->get('portfolio' , 10);
            
            
            $this->load->view('blog_view' , $data);
        }
    
}

?>


Messages In This Thread
Ordering DB results by date - by El Forum - 07-31-2008, 10:37 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:40 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:54 AM
Ordering DB results by date - by El Forum - 07-31-2008, 10:58 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:07 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:14 AM
Ordering DB results by date - by El Forum - 07-31-2008, 11:26 AM
Ordering DB results by date - by El Forum - 07-31-2008, 12:10 PM
Ordering DB results by date - by El Forum - 08-01-2008, 12:02 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.