Archive for May, 2007

MSSQL with PHP on Windows.

Wednesday, May 30th, 2007

Ironic isn’t it? The MSSQL extension for PHP works better on Linux than it does on Windows.

Since the beginning of time, the MSSQL extension for PHP on Windows had a problem where empty varchar fields came through containing a space. The problem was caused by Microsoft’s own library returning the space to the PHP extension. Whether or not this was actually a bug is a different debate (Sybase docs make some strange statements that allude to, but don’t completely explain this behaviour) however what is certain is that it is a pain in the ass. Empty strings (”") are not ” “, which is not null!

So, this was transparently trimmed by PHP and happily passed to the script as an empty string, which was of course broken (some people actually want string values with 1 space in them). So this was corrected with the release of 4.3.4, which caused much screaming and gnashing of teeth.

Of course, while all this was happening, those users running PHP on Linux using FreeTDS were happily sitting back watching the fireworks as their library for interfacing with SQL Server was all good and showed empty strings for what they are, empty strings.

Thankfully, some bright spark at kromann.info had the idea of compiling the FreeTDS library as a DLL for use under Windows. Before you go and say that it a rather obvious fix, ask yourself when the last time you compiled PHP under Windows was!

Anyway, using it is a simple matter, just download php_dblib.dll for your version of PHP (the link is on the right under the PHP section of the site) and throw it in with the other extensions. Add it to your php.ini, setup a freetds.conf in your c:\ and you should be laughing. Note that you need to connect through a TDS DSN entry in the freetds.conf file as the server address, and the tds version must be at least 7 (”tds version = 7.0″).

I am extremely grateful that this library is available and replacing the antiquated php_mssql.dll with it will be the first thing I do when setting up a Windows dev environment. Check it out.

Adobe Creative Suite 3

Sunday, May 6th, 2007

Just for all those people who, like me, are running Vista and had the CS3 installer crash out rudely on them, there is a relatively simple fix you can do.

Start -> Run -> cmd -> OK
cd c:\windows\system32
regsvr32 jscript.dll

It appears that if the jscript object is not registered, the installation script just panics and dies. This took a bit of head scratching, uninstalling, running clean-up scripts, disabling virus scanners until I looked at the event viewer and saw a nice error in the Application log stating “Product: Adobe Setup — Internal Error 2739″. A quick google turned up this page, which was for a different application, but with a similar issue.

Hope this saves someone a lot of grief.

Ce-Bit Sydney 2007

Sunday, May 6th, 2007

Each year for Ce-Bit the Queensland ICT purchases a stand to help small Queensland business show off their technologies. Imagin8 has taken advantage of this for the last 2 expos, managing to secure ourselves a small slice of floor space in the vast expanse of the Sydney Exhibition Centre.

Last year, it was just 2 of the guys representing, however this year with a few more staff to hold the fort, they decided to take me along for the ride. (more…)