开发者

How to connect to MSSQL from windows and ubuntu, without writing two sets of code?

My production machine is ubuntu, and my dev machine is windows. If I want to connect to a MSSQL server, from both ubuntu and windows, how do I do it? I'm able to use microsoft's library to connect to the database from my dev machine, but this wouldn't work on the ubuntu m开发者_StackOverflowachine, correct?


You can use the PDO SQL Server driver from Microsoft when on Windows and the PDO DLIB when on Linux. Other than connecting, you're code will be the same.

If you're unable to use either of those drivers, you'll have to look into PHP ODBC.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜