Welcome Guest, Not a member yet? Register   Sign In
Ordering DB results by date
#7

[eluser]patrick-vibes[/eluser]
Using this:

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");    
            $query = $this->db->get('portfolio' , 10);
            $result=$query->result_array() ;
            print_r($result);
            $this->load->view('blog_view' , $data);
        }
    
}

?>


Gives this error:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: query

Filename: views/blog_view.php

Line Number: 19

Use short hand? I am trying not too - I know its a but i was worried about server compatibility once completed and migrated.


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



Theme © iAndrew 2016 - Forum software by © MyBB