Is this possible to use this database

Hi, is it possible to use SQL SERVER 2008r2 as my database in my php application programs.?because i only experience using the wampserver and mysql as my database…if php can talk to sql server can you help me please how can i use sql server as my database.

Thank you in advance.

You can use PDO to connect to it.

The following drivers currently implement the PDO interface:
[TABLE=“class: doctable informaltable”]
[TR]
[TH]Driver name
[/TH]
[TH]Supported databases[/TH]
[/TR]
[TR]
[TD]PDO_CUBRID[/TD]
[TD]Cubrid[/TD]
[/TR]
[TR]
[TD]PDO_DBLIB[/TD]
[TD]FreeTDS / Microsoft SQL Server / Sybase[/TD]
[/TR]
[TR]
[TD]PDO_FIREBIRD[/TD]
[TD]Firebird/Interbase 6
[/TD]
[/TR]
[TR]
[TD]PDO_IBM[/TD]
[TD]IBM DB2[/TD]
[/TR]
[TR]
[TD]PDO_INFORMIX[/TD]
[TD]IBM Informix Dynamic Server[/TD]
[/TR]
[TR]
[TD]PDO_MYSQL[/TD]
[TD]MySQL 3.x/4.x/5.x[/TD]
[/TR]
[TR]
[TD]PDO_OCI[/TD]
[TD]Oracle Call Interface[/TD]
[/TR]
[TR]
[TD]PDO_ODBC[/TD]
[TD]ODBC v3 (IBM DB2, unixODBC and win32 ODBC)[/TD]
[/TR]
[TR]
[TD]PDO_PGSQL[/TD]
[TD]PostgreSQL[/TD]
[/TR]
[TR]
[TD]PDO_SQLITE[/TD]
[TD]SQLite 3 and SQLite 2[/TD]
[/TR]
[TR]
[TD]PDO_SQLSRV[/TD]
[TD]Microsoft SQL Server / SQL Azure[/TD]
[/TR]
[TR]
[TD]PDO_4D[/TD]
[TD]4D[/TD]
[/TR]
[/TABLE]

PDO also has the advantage of a “common interface” for different servers so provided you stick to standard SQL and don’t use any vendor specific/only SQL then you would be able to easily migrate to a different server at a later date

Hi, Thank you for the reply…how to get started on this,i want sql server 2008r2 as my database,what is the steps to connect ?

Thank you in advance.

Do you HAVE the database installed/available already?

If yes then read the PDO section of the PHP manual, code something up then come back for help. :slight_smile:

If no then this is not the board to ask questions about installing a database.

Yes, i already installed…can i ask with you i found in google using odbc…setting up a data source ?do i need to set up also on this in PDO ?

http://php.net/manual/en/book.pdo.php

http://php.net/manual/en/ref.pdo-sqlsrv.php

Thank you for this.