Microsoft have provided a PHP driver for SQL Server 2005.
At the time of this note, the link to it is: http://msdn.microsoft.com/en-us/library/cc296221.aspx
If that doesn't work, search MSDN for "SQL Server 2005 Driver for PHP"
Installation/Konfiguration
Inhaltsverzeichnis
Anforderungen
Voraussetzungen für Win32-Plattformen.
Für die Erweiterung müssen die MS SQL Client Tools auf dem System installiert sein, auf dem PHP installiert ist. Die Client Tools können entweder von der MS SQL Server-CD oder durch kopieren der ntwdblib.dll von \winnt\system32 auf dem Server nach \winnt\system32 auf dem PHP-Rechner installiert werden. Mit dem Kopieren der ntwdblib.dll wird nur der Zugriff durch benannte Pipes (named pipes) unterstützt. Für die Konfiguration des Clients ist eine Installation aller Tools nötig.
Voraussetzungen für Unix/Linux-Plattformen.
Um die MSSQL-Erweiterung unter Unix/Linux nutzen zu können, müssen Sie zuerst die FreeTDS-Bibliothek übersetzen und installieren. Quellcode und Installationsanleitung stehen auf der FreeTDS-Homepage zur Verfügung: » http://www.freetds.org/
Hinweis: Unter Windows wird die DBLIB von Microsoft verwendet. Funktionen, die einen Feldnamen zurückgeben, basieren auf der DBLIB-Funktion dbcolname(). DBLIB wurde für den SQL Server 6.x entwickelt, bei dem die maximale Länge der Bezeichner bei 30 liegt. Aus diesem Grund ist die Länge von Feldern auf maximal 30 Zeichen begrenzt. Auf Plattformen, auf denen FreeTDS verwendet wird (Linux) gibt es dieses Problem nicht.
Hinweis: Unter Windows funktioniert die MSSQL-Erweiterung nicht mit SQL Server 2005 oder höher, weil die interne API von ntwdblib.dll ab SQL Server 2005 nicht mehr unterstützt wird. Ab SQL Server 2005 müssen Sie die ODBC-Erweiterung verwenden.
Installation/Konfiguration
24-Sep-2008 03:49
18-Jun-2008 01:55
I was having a difficult time getting four Windows 2003 Servers to connect to an MSSQL database with PHP 5.2.5 and IIS after already getting one such server to connect with no problems. I even copied the entire php directory and dlls to the other servers exactly as they were on the working server but continually got "Unable to connect to server" errors. The fix was to delete the ntwdblib.dll from the PHP directory. It was already in the C:\windows\system32 directory and this did not cause a problem on the first server but did on all the others.
27-May-2008 10:06
The 30-character limitation does not apply to the FreeTDS db-lib implementation. FreeTDS returns column names of any length supported by the server (and protocol).
