Jump to content

Echo Random Correctly


justlukeyou

Recommended Posts

Hi,

 

I have it like this so far but it creats the error below.

 

<?php
$query = mysql_query("SELECT * FROM productdbase RAND() LIMIT 1");
while($row = mysql_fetch_array($query)) {
?>
<a href="/products/product.php?product_id=<?php echo $row['product_id']; ?>" class='productlink' rel="nofollow" ><?php echo $row['name']; ?></a>
<?php
}
?>

 

mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/ukhomefu/public_html/indextest.php on line 169

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.