php 中 mssql 扩展的建议迁移路线是什么
以前可能有人问过这个问题,但我在任何地方都找不到。
我刚刚发现 mssql 扩展已从 php 中转储(我知道那是不久前的事,我有点慢)。
我有一个旧应用程序正在使用它和所有 mssql_query 等功能。我想知道建议的路线是什么?
- PDO?
- 微软的驱动程序
- 转移到另一个数据库?
我并不完全反对迁移到 mysql,因为每次我必须移动盒子时,让 MSSQL 与 php 一起正常工作都会遇到很大的问题。旧的 mysql 扩展是否仍然受支持,或者我是否需要迁移到 PDO?
有没有简单的方法可以迁移到 PDO?欢迎任何建议。
This has probably been asked before but I can't find it anywhere.
I have just found out that the mssql extension has been dumped from php (I know it was a while ago I'm a bit slow).
I have a legacy app that is using it and all the mssql_query etc functions. I'm wondering what the suggested route is?
- PDO?
- Microsofts Driver
- Move to another DB?
I'm not entirely averse to moving to mysql since everytime I have to move boxes I have huge issues getting MSSQL to work correctly with php. Is old mysql extension still supported or do I need to move to PDO anyway?
Is there an easy way to move to PDO? Any suggestions welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论如何,建议使用 PDO 来抽象数据库连接,因此如果您使用 MySQL,我强烈建议使用它。如果您在连接到 SQL Server 的 Windows 环境中,那么 MS SQLSRV 库可能是一个不错的选择。我过去在处理 MSSQL 时使用过 odbc_* 函数,没有任何问题,包括调用存储过程以及我自己的查询。
不过,另一个没有操作系统锁定的数据库也是一个不错的举措。 MySQL 无处不在,但在没有先做一些研究的情况下,不要排除其他选择。
PDO is recommended anyway to abstract to DB connections, so if you go to MySQL I'd highly recommend using it. If you're on windows environments connecting to SQL server then the MS SQLSRV library is likely a good route to take. I have used the odbc_* functions when dealing MSSQL in the past with no problems, including calling stored procs as well as my own queries.
Another DB which didn't have OS lock in would be a good move too though. MySQL is ubiquitous, however don't rule out alternatives without doing some research first.