I Need Help with Random Loop

Discussion in 'PHP' started by sharingbuzz, May 18, 2010.

  1. #1
    Hi All,

    I want this to show in random form

    Demo:
    http://www.allworldinstruments.com/detail.php?nod=1554

    I want to show More Products in Random Form

    Please help me to set the following query in Random From ORDER BY RAND()

    $sql = "Select * from ".$tbl_2." where pshow = 'Yes'  AND mainid = ".$p_sid." AND subid <> ".$nod." order by ranking limit 8";
    Code (markup):
    Thanks
     
    sharingbuzz, May 18, 2010 IP
  2. sharingbuzz

    sharingbuzz Member

    Messages:
    332
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #2
    Dear. One Person has helped me

    Thanks

    that is code
    $sql = "Select * from ".$tbl_2." where pshow = 'Yes' AND mainid = ".$p_sid." AND subid <> ".$nod." order by RAND() limit 8";


    Please Close this thread
     
    Last edited: May 18, 2010
    sharingbuzz, May 18, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    You need to Show them i Random form right
    Just change your
    order by ranking limit 8

    to

    order by RAND() limit 8

    here the code looks like

     
    roopajyothi, May 18, 2010 IP
  4. sharingbuzz

    sharingbuzz Member

    Messages:
    332
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #4
    Thanks roopajyothi
     
    sharingbuzz, May 18, 2010 IP