Development tips, help, and suggestions for building performant websites
Uncategorized
General – Still moving melikedev.com to VPS
05 months ago
by Mike Purcell
in Uncategorized
Been busy prepping the move for melikedev.com to it’s own vps. I figured it was time to break down and puppetize a lot of redundant work, and getting httpd and nginx puppetized is proving to take longer than I thought. Once the move is complete I will make another post, and start posting some of the dev articles I have in the backlog. Thanks for your patience.
MySQL – Query for Date Ranges Using Interval
01 year ago
by Mike Purcell
in Uncategorized
If you ever need to query for a date range on a date column, try the following example.
/* All records that are within a week */ SELECT * FROM <table_name> WHERE <some_date_column> BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW(); /* All records within the last 2 hours */ SELECT * FROM <table_name> WHERE <some_date_column> BETWEEN DATE_SUB(NOW(), INTERVAL 2 HOUR) AND NOW();