sotusotusotu Posted September 27, 2007 Share Posted September 27, 2007 Hey, In my database I have 2 fields (month and year). In the month field is the full month names (January through to December). In the Year field there are entries of 2006 and 2007 as there are only 2 years worth. I would like to be able to search through the fields find out what the first month and year entry is and display them inside a drop down menu through to the latest month (September 2007 down to the earliest) - but the latest month is not going to be the newest entry inside the database, it needs to be the month we are in (real time). Does anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/70902-checking-the-first-date-entry/ Share on other sites More sharing options...
rarebit Posted September 27, 2007 Share Posted September 27, 2007 Is this from sql? If so add two orders, first by year, second by month, then they should come out in the correct order. Personally I always store dates as timestamps, then it's all chronological anyway, just format at output time! Quote Link to comment https://forums.phpfreaks.com/topic/70902-checking-the-first-date-entry/#findComment-356420 Share on other sites More sharing options...
sotusotusotu Posted September 27, 2007 Author Share Posted September 27, 2007 Yes it is SQL. Thanks for the tips, will get cracking on it! Quote Link to comment https://forums.phpfreaks.com/topic/70902-checking-the-first-date-entry/#findComment-356438 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.