Query 5 Random Items - Loop Problem
Posted: Sun Aug 22, 2004 6:10 pm
Im trying to pull 5 random items from a database where status='selling' and I am getting a white page!
Regards,
Kevin
Code: Select all
$result = mysql_query("SELECT * FROM bookmark WHERE status='selling' ORDER BY rand() LIMIT 5");
$i=0;
while ($i < $result) {
//Dont I need this in there too:
//$bm_URL=mysql_result($result,$i,"bm_URL");
//$description=mysql_result($result,$i,"description");
echo "<a href="http://onestopauctionshop.com/spinco/hot_result.php?bm_URL=$bm_URL\>$description</a>";
++$i;
}Kevin