Fixed the date format to match MySQL.
Fixed a potential bug where the SF dates were getting passed to the drupal query instead of the MySQL dates.
Added some param and return types to the comments.