PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
shuffle() manipulates the array given to it. Since you are not assigning the results of array_keys() to a variable, therefore the array is never actually changed.
OK. I think I see what's happening. I get random key values from the array. What I want is random "rows" from the array, as in random results from a query.
$query = "SELECT * FROM books ORDER BY rand() LIMIT 3;";
$result = mysql_query($query, $conn) or die(mysql_error());
for ( $i=0; $i<3; $i++){
$row = mysql_fetch_array($result);
This is the effect I was looking for. Thanks for helping me sort through this.