Jump to content

Shuffle Mysql_fetch


allex01

Recommended Posts

<?php
$query = "SELECT product_name FROM products" ;
$results = mysql_query($query)  or die(mysql_error());
while($row = mysql_fetch_array($results))
{
    $results2= $row['product_name'];

shuffle($results2);
echo $results2;
}?>

 

Just a question. If i used this solution. Wouldn't this cause the result to appear more then once. How will it know the result was not already output before.

Link to comment
https://forums.phpfreaks.com/topic/94413-shuffle-mysql_fetch/#findComment-483573
Share on other sites

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.