how to show records for next 2 month in php and mysql?

Discussion in 'PHP' started by kcm4web, Mar 30, 2010.

  1. #1
    hi there

    i have a list page where i want 2 show drives for next 2 month. i am using php in front end and mysql as backend. can anybody help me??
     
    kcm4web, Mar 30, 2010 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    You can do a query like this

    
    $sql = 'SELECT * FROM tablename WHERE date>="'.date('Y-m-d').'" AND date <="'.date('Y-m-d',strtotime('+2 months')).'"';
    
    PHP:
    Hope you get the idea.
     
    stephan2307, Mar 30, 2010 IP
  3. kcm4web

    kcm4web Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks a lot for ur help...
     
    kcm4web, Mar 30, 2010 IP
  4. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #4
    No prob. Always happy to help
     
    stephan2307, Mar 30, 2010 IP