i am trying to fetch random records from mysql database , which it worked but i need the records to be also unique when i fetch them as they duplicated on the output, here is my code:
<?
for ($counter = 1; $counter <=5;$counter++)
{
$randomPostSelect = mysql_query("SELECT DISTINCT * FROM beventreservation WHERE (beventStatus='online' OR beventStatus='soldout') ORDER BY RAND() LIMIT 5") or die(mysql_error());
$fetchPosts = mysql_fetch_array($randomPostSelect) or die(mysql_error());
echo '<li><a href="reservation.php?rev='.$fetchPosts['eventId'].'">'.$fetchPosts['eventTitle'].'</a></li>';
echo '</br>';
}
?>
how can i do that ?