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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.