Jump to content

shuffle results acording to serial number


vinpkl

Recommended Posts

hi all

 

i have 50 products and want to show 4 at a time and shuffle them on manual refresh.

 

like serial 1 to 4 , then serial 4 to 8, then serial 8 to 12, then 12 to 16.

 

i have used rand() function and it displays results by its own. not serial wise.

 

how is it possible. this is my code

 

<?php 
echo "<table>";
echo "<tr>";
$qry1="select * from product_table where category_id=1 and status='Y' ORDER BY RAND() LIMIT 0,4";  
$result1 = mysql_query($qry1);  
        
   if(mysql_num_rows($result1)>0)
   {
   while($row1=mysql_fetch_array($result1))
   {
     echo "<td width=148 valign=top>";
      echo "<table>";
      echo "<tr>";
      echo "<td valign=top  width=125>". $row1['product_name'] . "</td>";
      echo "</tr>";
      echo "<tr>";
      echo "<td valign=top>". $row1['description'] . "</td>";
      echo "</tr>";
      echo "<tr>";
      echo "<td valign=top class=cut>". "NZ$ " . $row1['cutout_price'] . "</td>";
      echo "</tr>";
      echo "<tr>";
      echo "<td valign=top class=price>". "NZ$ " .  $row1['price'] . "</td>";
      echo "</tr>";
  echo "</table>";
echo "</td>";
   }
     }
echo "</tr>";


echo "</table>"; 
?>

 

vineet

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.