简体   繁体   English

我可以使用 PHP SQL 服务器扩展连接到 MySQL 数据库吗?

[英]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您需要使用PDOmysqli从 PHP 连接到 MySql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用php连接到SQL Server - How can I connect to SQL Server with php 如何在PHP中使用PDO从SQL Server DB中获取数据并在以UTF-8编码的MySQL DB中正确编码? - How do I use PDO in PHP to get data out of a SQL Server DB and properly encode it in a UTF-8-encoded MySQL DB? 为什么我可以在XAMPP中使用PHP连接到MySQL服务器,但不能连接到Uniform Server? - Why can I connect to a MySQL server with PHP in XAMPP but not Uniform Server? 如果我将php与sql server(mssql)或oracle一起使用,如何使用mysql_error()函数 - how i can use mysql_error() function if i use php with sql server(mssql) or oracle 我可以使用哪个版本的PHP连接到SQL Server 2000数据库? - What version of PHP can I use to connect to a SQL Server 2000 database? 可以使用Java而不是PHP连接到MySQL数据库吗? - Can connect to MySQL db with java but not with PHP? Codeigniter-如何连接ORACLE,MySQL和SQL Server? - Codeigniter - How can I connect ORACLE, MySQL and SQL Server? 无法启用mysqli扩展-PHP 7.1.12,无法连接到数据库 - Can not enable mysqli extension - PHP 7.1.12, can't connect to db 为什么我不能使用PHP连接到Sql Server? - Why can't I connect to a Sql Server with PHP? 如何使用PHP PDO从Mac连接到Sql Server? - How can I connect to Sql Server from a Mac with PHP PDO?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM