select posts depending on month

Discussion in 'Databases' started by piniyini, Oct 2, 2005.

  1. #1
    I wanna make an archives section for my site, is there any way to select posts depending on the month. The posts have a date/time field in the db.

    I think its gonna be something like this

    select * from `table` where `date_time` = january

    or some crap like that?
     
    piniyini, Oct 2, 2005 IP
  2. discoverclips

    discoverclips Peon

    Messages:
    491
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    yeah seems good. something like SELECT content FROM table WHERE 'date'=january;
     
    discoverclips, Oct 2, 2005 IP
  3. piniyini

    piniyini Well-Known Member

    Messages:
    514
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    170
    #3
    yeh but date/time is in the format of 2005-09-28 09:53:06 - how do i select posts depending on the month?
     
    piniyini, Oct 2, 2005 IP
  4. piniyini

    piniyini Well-Known Member

    Messages:
    514
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    170
    #4
    its ok guys i got it ;-)
     
    piniyini, Oct 2, 2005 IP