MySQL Strict Mode

If you are running an older version of osCommerce (MS 2.2, RC 2a or early releases of 2.3) then you might find your site stops working when your hosting company upgrades the version of mySQL in use.

The most simple fix is for the hosting company to set sql_mode to null.  But many are refusing to do that.  So how can you easily over-ride that?

There is a simple patch you can make to your includes/functions/database.php files.

Find the function tep_db_connect function which should be at the top of the code.  At the end of that function before

return $$link;

add the line

@mysqli_query($$link, 'set session sql_mode=""');

This will reset sql_mode to null each time.

Need help?  Contact us and we can make this change for you.