Magento Imagine Awards 2019 Finalist

PHP MSSQL and DataType `smalldatetime`

During the development of a project we ran into a problem when using mssql_query() on a Microsoft SQL Database table with a column of a datatype `smalldatetime`. 

It would appear PHP was returning a dataset from MSSQL but was not allowing the script to continue processing even though a valid dataset was returned.  After some digging we found a bug on the PHP website, inherently there was a short term fix which is to disable the converting of MS SQL `smalldatetime` to a PHP date.

Disabling the converting of a MSSQL datetime to a PHP date was quite simple;

ini_set('mssql.datetimeconvert', 0);

I hope this finds someone well.


Subscribe via email

Sign up to get notifications of new posts by email.

Share this article

Posted in Development

Call us on 01785 279920

Our friendly Magento experts are happy to answer your questions.

Follow us!

Get the latest eCommerce news, reviews and expert advice in your inbox.

To find out more about how we use your data, read our Privacy Policy