Hi,
I hope this piece of code will help you a bit, as i first 'count' the number of database results and then get a random number between the min and max.
Greetz, Paul
// banner randomize
if ($rand==1) {
$selectSQL = "SELECT bannerid FROM banners WHERE forumid=0";
$executeSQL = mysql_query($selectSQL);
$arraycount=0;
while ($arraytemp = mysql_fetch_array($executeSQL)) {
$arraycount=$arraycount+1;
}
$array=mt_rand(0,$arraycount);
}