Need to set session before select

I’m trying to do this. I know this is wrong, but how do I ensure my sql_mode is forced before this select?

   $sqlChartData = $pdoConnection_HydesDirect -> prepare("SET SESSION sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; select date_format(order_date, '%M %Y'), sum(order_total) from FallsAppOrders group by year(order_date), month(order_date) desc limit 3");
   $sqlChartData -> execute();
Sponsor our Newsletter | Privacy Policy | Terms of Service