Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Remi Collet:
Microsoft SQL Server from PHP
Sep 23, 2016 @ 16:57:34

In this recent post to his site Remi Collet shows you how to set up your PHP installation to allow it to work with a Microsoft SQL Server as it's data store.

Here is a small comparison of the various solutions to use a [Microsoft SQL Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) database from PHP, on Linux. All the tests have be run on Fedora 23 but should work on RHEL or CentOS version 7.

Several different extensions were tested as a part of making the connection to the SQL server:

  • Using PDO, ODBC and FreeTDS
  • Using PDO, mssql and FreeTDS
  • Using PDO, ODBC and Microsoft® ODBC Driver
  • Using the Microsoft® Driver
  • Using PDO and the Microsoft® Driver

Each item comes with a list of the requirements involved (other modules/extensions), examples of the configuration changes you'll need to make and some sample code to create the connection.

tagged: tutorial microsoft sql sqlserver database connection example testing

Link: http://blog.remirepo.net/post/2016/09/20/Microsoft-SQL-Server-from-PHP


Trending Topics: