Mysql query.

Discussion in 'PHP' started by baris22, Jan 11, 2008.

  1. #1
    Hello,

    I need a query. i could not figure it out how to do. I need to display the most visited videos in category 4,5 and 6. I can display the most visited ones on category 4 doing by

    
    $sql = "select uniq_id, artist, video_title, yt_views, site_views, added FROM pm_videos WHERE category='4' ORDER BY yt_views DESC LIMIT 50" ;
    
    PHP:
    So instead of category 4, how can i do category 4,5 and 6

    Thanks
     
    baris22, Jan 11, 2008 IP
  2. woods

    woods Peon

    Messages:
    228
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $sql = "select uniq_id, artist, video_title, yt_views, site_views, added FROM pm_videos WHERE category='4' OR category='5' OR category='6' ORDER BY yt_views DESC LIMIT 50";
    Code (php):
    ^Should be fine.
     
    woods, Jan 11, 2008 IP
  3. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    thank you.

     
    baris22, Jan 11, 2008 IP