Query bug workaround - the correct way to do it? ( \PDO::ATTR_EMULATE_PREPARES )

Hello, I have a query that on my live server (but not on the test server - yeah that's confusing) throws a "General error: 1615 Prepared statement needs to be re-prepared" after some Googling people seem to get around this by adding this to config/database.php