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`. 

php

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.


Share this article

Posted in Development

Call us on 01785 279920

Our friendly Magento experts are happy to answer your questions.

Contact us now

Email alerts

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