The sorry saga of varchar(Max) and ODBC in PHP

A project I’m currently working on uses SQL Server 2005 with PHP, the database being accessed via PHP’s ODBC library.

I have to admit that I love my Stored Procedures, and rather than use ‘inline’ SQL SELECT statements in my data classes I’ve usually used Stored Proceduers when talking to SQL databases in the past.

However….believe it or not this is the first PHP / SQL Server project I’ve ever done that used ODBC and also featured VARCHAR(Max) or Text fields….

Continue reading