My model returns data as mysql objects:
return $q->result();
Now, I want to shuffle/randomize the data and send it to the view file. But when I use the shuffle($data) on the object, it doesn't work, gives out an error. I guess, it will only work if my model returns an array.
Is there any way I can shuffle/randomize the data without converting it to an array, or without making the model return an array.
Message: Invalid argument supplied for foreach()Message is displayed in the view, where I use the foreach to loop through the shuffled result.