$sql = "SELECT m.id, m.name, m.picture, AVG(s.score) as average FROM models m LEFT JOIN scoring s ON s.id = m.id WHERE m.category = '$game' GROUP BY m.id ORDER BY average DESC"; $result = mysql_query($sql); $count = mysql_num_rows($result); $row = mysql_fetch_array($result); $contestants = array_rand($row, 10);I am getting an error:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array...[/quote]
I guess what I am trying to do may be a little different than what array_rand() is for. I rant to take 10 random rows and put them in the new array. The array $row has 30 rows of elements, and I want to take 10 on those.