code to test the success of php connection to mysql_php basics:
the method is very simple:
save the following code as test. php, just put it in the web directory and execute it.
<?php $link=mysql_connect("localhost","root","123"); if(!$link) echo "FAILD!连接错误,用户名密码不对"; else echo "OK!可以连接"; ?>
the parameters of the mysql_connect() function are: mysql server name or ip, mysql user name, and mysql user password.
the above is the code to test the success of php connection to mysql_php basic content. for more related content, please pay attention to the php chinese website (www.php.cn)!