hi folks
im using the following code
$query = "SELECT * FROM clients WHERE banner = '1' AND displays > '0' ORDER BY rand() LIMIT 1";
$result = mysql_query($query);
while ($r=mysql_fetch_array($result))
{
$id=$r["id"];
$pname=$r["pname"];
$area=$r["area"];
$star=$r["star"];
$displays++;
$update = "UPDATE clients SET displays=displays-1 WHERE id=$id";
$updatesql = mysql_query($update);
}
as my query and it is working brill
What i wish to do is display ideally 4 results from the DB but dont want to double display any of the results.
EG
id numbers in DB
1,2,3,4,5
want to dispay 4 chosen at random
1,5,2,3
dont want doubles like
1,4,2,1
Anyone able to help me at all?
David