as bradgrafelman said,
change this:
$query_order_date2 = "SELECT order_date.order_date, DATE_FORMAT(order_date, "%M %D, %Y") FROM order_date ";
to this (change outer quotes to single quote):
$query_order_date2 = 'SELECT order_date.order_date, DATE_FORMAT(order_date, "%M %D, %Y") FROM order_date';
OR this (escape inner quotes):
$query_order_date2 = "SELECT order_date.order_date, DATE_FORMAT(order_date, \"%M %D, %Y\") FROM order_date";
What is happening is the PHP parser gets to "%M and it thinks that the quote there is ending the string you started at "SELECT. then it gets what it thinks is garbage %M %D ... means nothing to PHP and thus the error.
Notice the difference in the syntax highlighting between the original and changed code? Sometimes you can run this command line:
php -s [yourfile].php > [newfile].html
This will produce you a nice HTML file with syntax highlighting. You can then scan through it and see problems like this in the file if you are really stumped. A good PHP text editor will do this for you automagically (like my favorite EditPlus http://www.editplus.com)
Hope this helps.
Mike