| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe to WebmasterWorld|
|Getting my head round dates with sql.|
| 1:55 pm on Oct 23, 2006 (gmt 0)|
I've been scratching my head about this for a while now.
I have a my sql DB that has a kind of diary in it.
I use a timestamp in this format 0000-00-00 00:00:00
OK this is what I want to do. Go through each day of the month and if there is an entry in the database for that day do something if not dont do anything.
It's just how I loop through the days of each month and stuff.
Maybe its the creation of the dates i'm stuck with.
Any help would be greatly appreciated!
| 2:57 pm on Oct 23, 2006 (gmt 0)|
Try a query like this:
$query = "SELECT * FROM table WHERE MONTH(timestamp) = '10'";
This should select all the rows where the month is '10'
Good luck! :)
| 9:33 am on Oct 24, 2006 (gmt 0)|
That is amazing.
I had to do some other stuff too but that really helped me find the sql functions page!
Thank you kindly!
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2013 all rights reserved