Welcome Guest, Not a member yet? Register   Sign In
Order BY not working
#2

[eluser]Georgi Veznev[/eluser]
[quote author="Thiago Leao" date="1289778449"]Hi friends,

I'm trying to Sort a list, but not working.
Code:
<?php
class Home_model extends Model{

    function listar_category(){    
    
        $query = $this->db->get('category');
        $this->db->orderby("id_category", "asc");
        return $query->result();
    }
    
}
?>

I know there must be something very simple, but I'm not getting.
I'm new at CI, i'm sorry!

thanks[/quote]


Code:
<?php
class Home_model extends Model{

    function listar_category(){    
        $this->db->order_by("id_category", "asc");
        $query = $this->db->get('category');
        return $query->result();
    }
    
}
?>


Messages In This Thread
Order BY not working - by El Forum - 11-14-2010, 11:47 AM
Order BY not working - by El Forum - 11-14-2010, 11:52 AM
Order BY not working - by El Forum - 11-14-2010, 12:08 PM
Order BY not working - by El Forum - 02-19-2011, 01:44 PM
Order BY not working - by El Forum - 02-19-2011, 03:00 PM
Order BY not working - by El Forum - 02-19-2011, 06:30 PM
Order BY not working - by El Forum - 02-20-2011, 10:48 AM
Order BY not working - by El Forum - 02-20-2011, 12:36 PM
Order BY not working - by El Forum - 02-20-2011, 07:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB