We're a finalist for the eCommerce awards 2017.

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

Other posts you might like

Importing and Exporting data in Magento using the data-flow profiles has never been particularly quick, neither does it always work…

Optimising Magento Development

There are many available tools to help make Web Development projects quicker and more productive. We will look at how…

Recently in the office chatroom we had a discussion regarding PHP’s short tags:   For those that don’t know what…

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.