Code sharing to test whether PHP connection to MySQL is successful_PHP tutorial

WBOY
Release: 2016-07-13 10:40:25
Original
976 people have browsed it

In many cases we don’t know whether it is a PHP error or an incorrect mysql username and password that causes cms operation errors. You can test it with the following code first

The method is simple: ​ Save the following code as test.php, put it in the web directory and execute it. ​ The code is as follows: ​ ​ The parameters of the mysql_connect() function are: mysql server name or IP, mysql user name, and mysql user password.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/727551.htmlTechArticleIn many cases we don’t know whether it is a php error or an incorrect mysql username and password that causes a cms operation error. You can use Just test the following code. The method is very simple: change the following...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!