Page 1 of 1

Query 5 Random Items - Loop Problem

Posted: Sun Aug 22, 2004 6:10 pm
by ripcurlksm
Im trying to pull 5 random items from a database where status='selling' and I am getting a white page!

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;
}
Regards,
Kevin

Posted: Sun Aug 22, 2004 6:17 pm
by feyd

Code: Select all

while($row = mysql_fetch_assoc($result))
{
  var_dump($row);
}