Let's say I've got a mySQL database: two columns: ID and names, with 100 rows. What I'd like to do is pick out say 10 names - with no repeats - and display them in random order.
Using this code, I can pick out just one name...
<?php
include('connection.php');
$rand = rand(1, 100);
$sql = "SELECT * FROM names WHERE ID=$rand";
$result = mysql_query($sql, $sandbox);
while ($row = mysql_fetch_array ($result))
{
$name1 = $row['Name'];
echo $name1 . "<br>";
}
?>
... what would be the best code to get my 10 random nonrepeating names?