[eluser]xwero[/eluser]
No there is no performance benefit and i don't think this should go in the query for two reasons
- if you want to use that model method again for other adding a RAND function based pseudo field to the result.
- The RAND function in mysql only capable of setting a maximum. the minimum is always zero
But if you do use the model method only for that page i would recommend you do add the random number to the model but also output the result instead of the query.
Code:
function somemethod()
{
$rows = $this->db->get('table')->result();
foreach($rows as $row)
{
$row->random = mt_rand(1,6);
}
return $rows;
}
This way the view doesn't know where the content comes from what makes it easier to reuse it.