Right now I'm selecting 3 random rows from a table using ORDER BY Rand();
as pointed out all over the web this method is very slow. I am using it on a database with only 30 rows and it takes a long time to return the value. Most of the other solutions i've found only return one row. What's the best way to return multiple random rows?
$get_projects_query =
mysql_query(
"SELECT p_id FROM project_data WHERE p_featured='1' ORDER BY Rand() LIMIT 3"
) or die(mysql_error());
while($project_row = mysql_fetch_array($get_projects_query)) {?>
//Do stuff
}
//end three random featured projects loop)