Welcome Guest, Not a member yet? Register   Sign In
Change order of foreach loop?
#2

[eluser]Developer13[/eluser]
Couple of ways you could achieve this.

1 - Using get_where() and order_by():

$this->db->order_by('date DESC');

$query = $this->db->get_where('table', array('this' => $that));

2 - Using plain old get() and order_by() with where():

$this->db->order_by('date DESC');

$this->db->where('this', $that);

$query = $this->db->get('table');


Messages In This Thread
Change order of foreach loop? - by El Forum - 09-25-2008, 07:47 PM
Change order of foreach loop? - by El Forum - 09-25-2008, 08:09 PM
Change order of foreach loop? - by El Forum - 09-25-2008, 09:47 PM
Change order of foreach loop? - by El Forum - 09-25-2008, 10:11 PM
Change order of foreach loop? - by El Forum - 09-25-2008, 10:13 PM
Change order of foreach loop? - by El Forum - 09-26-2008, 07:49 AM
Change order of foreach loop? - by El Forum - 09-26-2008, 08:25 AM
Change order of foreach loop? - by El Forum - 09-26-2008, 06:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB