[英]Can i use PHP SQL server extension to connect to a MySQL db?
I want to test some SQL server functions like sqlsrv_connect, i installed sqlsrv driver succesfully, is it possible to use the sqlsrv_connect function to connect to a MySQL database or do i have to install a MS SQL Server ?我想测试一些 SQL 服务器功能,如 sqlsrv_connect,我成功安装了 sqlsrv 驱动程序,是否可以使用 sqlsrv_connect 功能连接到 MySQL 数据库,或者我必须安装 MS SQL Server 吗?
Thank you谢谢
Quoting the PHP Manual :引用PHP 手册:
The SQLSRV extension allows you to access Microsoft SQL Server and SQL Azure databases when running PHP on Windows.
SQLSRV 扩展允许您在 Windows 上运行 PHP 时访问 Microsoft SQL Server 和 SQL Azure 数据库。
So, you have to install a MS SQL Server.因此,您必须安装 MS SQL Server。 Because that's what the extension is for.
因为这就是扩展的用途。
sqlsrv_connect
only connects to a MS SQL Server. sqlsrv_connect
仅连接到 MS SQL Server。 You need to use either PDO
or mysqli
to connect to MySql from PHP您需要使用
PDO
或mysqli
从 PHP 连接到 MySql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.