PHP 7.2.0 Release Candidate 4 Released



Esta característica está OBSOLETA en PHP 7.0.0.

Las alternativas a esta característica son:

Estas funciones permiten el acceso a bases de datos de MS SQL Server.

Esta extensión ya no está disponible en Windows con PHP 5.3 o posterior.

SQLSRV, una extensión alternativa para conectividad con MS SQL, está disponible desde Microsoft: »

add a note add a note

User Contributed Notes 3 notes

rjaehnrich at gmail dot com
1 year ago
to use MSSQL-connections on Linux with PHP7 you can use PDO with PDO_DBLIB.

Install driver using this command:
sudo apt-get install php7.0-sybase

then simply connect with this:

= "dblib:host=" . $host . ":1433;dbname=" . $database;
$dblink = new PDO ($dsn, $user, $pass);

I got problems when i used the hostname, so i switched to the IP of the server.

Later I got problems to insert records into MSSQL-table.
This settings helped me out:

$dblink->exec("SET ANSI_PADDING ON");
$dblink->exec("SET ANSI_NULLS ON");
$dblink->exec("SET QUOTED_IDENTIFIER ON");
yanko dot costa at gmail dot com
7 months ago
The microsoft SQLSRV driver for linux is functional.

According Microsoft, version 4.0 (for Linux):
    Ubuntu 15.04 (64-bit)
    Ubuntu 16.04 (64-bit)
    Red Hat Enterprise Linux 7 (64-bit)


Instalations notes for Linux:
alvaro at demogracia dot com
7 years ago
SQLSRV is not exactly a "driver": it's a completely different PHP extension to access SQL Server databases and it has its own syntax and features. It's a Windows-only library developed and maintained by Microsoft and it's not related to the built-in SQL Server extension described here.

(Whatever, it's quite feature-rich and it's easy to learn.)
To Top