Page 1 of 1

confused :(

Posted: Mon Jan 24, 2005 5:28 pm
by Deemo
ok, let me briefly explain my situation. Basicly, right now in my database i have a Day, Month, and Year column. i need a query (or set of queries) to be able to select for example January 24th through Febraury 1st (in the database thats 24 1 2005 and 1 2 2005 each in a seperate column). Im so confused on how to get it :(

I was also thinking about maybe getting rid of the 3 columnds and making it 1 DATE type in the database, but ive never done this so i have no idea how to use it later in my PHP code. Like will i be able to read it from the database and be able to parse it into days, months, and years?

Thanks alot
Deemo


*waits for feyd 8O *

Posted: Mon Jan 24, 2005 5:30 pm
by hawleyjr
Setup your table with a date or datetime field. This will allow for easy date querys "Select * from table where date > $mydate";

Posted: Mon Jan 24, 2005 5:32 pm
by Deemo
yes, i know this, but then what will $mydate look like in the above example

Posted: Mon Jan 24, 2005 5:32 pm
by feyd
aye, young padawan.. a DATE field is best for this.. it's just a pain when they are seperate..

Posted: Mon Jan 24, 2005 5:35 pm
by hawleyjr

Posted: Mon Jan 24, 2005 7:45 pm
by magicrobotmonkey

Posted: Mon Jan 24, 2005 7:59 pm
by Deemo
thanks alot guys. ill come back in like an hour if i fubared my program ;) :P