PHP可以与MS SQL数据库配合使用 [英] Can PHP work with a MS SQL database

查看:133
本文介绍了PHP可以与MS SQL数据库配合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHP& MySQL,但我有一个潜在的客户端与MS SQL和ASP设置。由于一些复杂的原因和离线软件集成,他们需要保持数据库在相同的格式,这意味着不移动到MySQL,这将是我的个人喜好。

I work primarly with PHP & MySQL, but I have a potential client with a MS SQL and ASP setup. Due to some complicated reasons and offline software integration, they need to keep the databases in the same format, which means not moving to MySQL which would be my personal preference.

所以问题是我可以使用PHP访问和操纵一个MS SQL数据库,或者我拧在这一个?

So the question is can I use PHP to access and manipulate an MS SQL database or am I screwed on this one?

提前感谢

推荐答案

是的,可以。这取决于您使用的PHP版本,但如果您使用PHP5 +,则可以使用 Microsoft的SQL Server驱动程序。请确保您使用的是版本2,它提供了 PDO 功能以及过程风格。

Yes, you can. It depends on which version of PHP you're using, but if you're using PHP5+ you can use Microsoft's SQL Server Driver for PHP. Make sure you use version 2, which gives you the PDO functionality as well as the procedural style.

您也可以使用PDO ODBC驱动程序来访问SQL Server实例,但是这种方法更容易出错,我不推荐它。

You can also use the PDO ODBC driver to access a SQL Server instance, but that approach is more buggy and I don't recommend it.

最后,您可以使用PHP MSSQL 库,但更糟糕的是。如果可以,请使用Microsoft自己的解决方案。

Finally you can use the PHP MSSQL library but that's even worse. Go with Microsoft's own solution if you can.

编辑:哦,还有 DBLIB MSSQL PDO驱动程序 - 远离那个!

Oh, and there's also the DBLIB MSSQL PDO driver - stay away from that one too!

这篇关于PHP可以与MS SQL数据库配合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆