confused :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

confused :(

Post 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 *
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Setup your table with a date or datetime field. This will allow for easy date querys "Select * from table where date > $mydate";
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

yes, i know this, but then what will $mydate look like in the above example
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

aye, young padawan.. a DATE field is best for this.. it's just a pain when they are seperate..
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

thanks alot guys. ill come back in like an hour if i fubared my program ;) :P
Post Reply