mysql_connect introduction
php mysql_connect is used to connect to the mysql server. This function has multiple parameters, but we generally only need to understand the following three parameters:
mysql_connect(server,user ,pwd)
Parameter introduction:
server -- mysql server address
user -- server user name
pwd - - Server login password
If the connection is successful, a MySQL connection ID is returned, if the connection fails, FALSE is returned.
mysql_connect instance
<?php $host="mysql153.secureserver.net"; $uname="root"; $pass="password"; $connection= mysql_connect ($host, $uname, $pass); if (! $connection) { die ("mysql服务器连接失败"); } else { echo "恭喜你!mysql服务器连接成功"; } ?>
Thank you for reading, I hope it can help everyone, thank you for your support of this site!