Can php use Microsoft SQL server for database instead of the internal mysql database? If yes, what is the method of connecting to MS SQL server?
Asked
Active
Viewed 78 times
0
-
http://stackoverflow.com/questions/5953882/connecting-to-mssql-using-pdo-through-php-and-linux – Pred Nov 12 '14 at 15:44
-
7`internal mysql database` ? – Daan Nov 12 '14 at 15:44
-
3MySQL is not internal to PHP – Mark Baker Nov 12 '14 at 15:45
-
See http://php.net/manual/en/book.mssql.php – Mark Baker Nov 12 '14 at 15:46
-
If you mean if the mysqli extension supports SQL Server, well, of course not. That's why it's called mysqli. – Álvaro González Nov 12 '14 at 15:56
1 Answers
0
Try PDO library. It is useful. I used in one bigger project (MS SQL + PHP 5.3). You also need a proper database driver. First link from Google: http://www.microsoft.com/en-us/download/details.aspx?id=20098

Andrzej Bobak
- 2,106
- 3
- 28
- 36
-
1I suspect Daan means that PDO isn't simply an automagic connection to every possible database, you need to install the MSSQL drivers for PHP whether you use that interface directly, or you use PDO – Mark Baker Nov 12 '14 at 15:47
-
You're right. I focused on the source code level (how to access database effectively). – Andrzej Bobak Nov 12 '14 at 15:53
-
Note that this only applies if you are running php on windows. linux/php <--> windows/mssql is a pig. – Steve Nov 12 '14 at 15:59