Welcome Guest, Not a member yet? Register   Sign In
Randomize Active Record Results
#5

[eluser]jpschroeder[/eluser]
@PhilTem What you are propsing will work. I could run something of this sort:

Code:
$query = $this->db->get($table);
$results = range(0,$query->num_rows()-1);
shuffle($results);
foreach($results as $row_num){
   $row = $query->row($row_num);
}

I'm just being picky at this point, but I was hoping to do something like the following:

Code:
$query = $this->db->get($table);
$this->db->shuffle($query);
....
//move on with output

Unless someone knows how do do something like that, consider this post solved! Thanks!


Messages In This Thread
Randomize Active Record Results - by El Forum - 05-17-2012, 09:09 PM
Randomize Active Record Results - by El Forum - 05-17-2012, 09:22 PM
Randomize Active Record Results - by El Forum - 05-18-2012, 12:50 PM
Randomize Active Record Results - by El Forum - 05-18-2012, 01:03 PM
Randomize Active Record Results - by El Forum - 05-22-2012, 12:55 PM
Randomize Active Record Results - by El Forum - 05-22-2012, 02:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB