Code to test the success of PHP connection to MYSQL_PHP Tutorial

WBOY
Release: 2016-07-21 14:59:07
Original
891 people have browsed it

The method is very simple:

Save the following code as test.php, put it in the web directory and execute it.

Copy code The code is as follows:

$link=mysql_connect("localhost" ,"root","123");
if(!$link) echo "FAILD! Connection error, wrong username and password";
else echo "OK! Can connect";
?>


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/328167.htmlTechArticleThe method is very simple: Save the following code as test.php, put it in the web directory and execute it. Copy the code The code is as follows: ?php $link=mysql_connect("localhost","root","123"); if(!$lin...
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