1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Damn quick php/mysql date/sorting question

Discussion in 'HTML, Graphics & Programming' started by AtomicBanana, 8 Jun 2006.

  1. AtomicBanana

    Wise Guy

    Joined: 28 Sep 2003

    Posts: 1,724

    Location: Leamington Spa

    Hi there guys, I've been off and on learning PHP for a little while now, and as I've had some time returned to one of my projects. Currently I can't quite work out how to achieve the function I'm looking for.

    The project I'm working on is a little games database for my own personal use - logging when I bought it, how much it cost etc. Iv'e got the main bit working, can add them, sort by date, name, publisher etc. What I want to do now is have it so I can do things like 'show games bought in last 6 months' 'show games bought in last month' and so on. I have the data information stored as a date type in the database (stored as '2006-03-24' for example). But I can't seem to get a query that does this. I've tried googling for it, but as I don't know quite what I'm looking for the results are quite broad :(

    So show up my poor knowledge of php/mysql ;)

    /cheers
     
    Last edited: 8 Jun 2006
  2. Beansprout

    Man of Honour

    Joined: 31 Jan 2004

    Posts: 16,313

    Location: Plymouth

    It's amazing what MySQL can do now :D :)