Maison >développement back-end >tutoriel php >PHP 连接mysql数据库
PHP 连接mysql数据库
<?php $dbhost = 'localhost:3306'; $dbuser = 'root'; $dbpass = 'root'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { echo 'Connect failure'; } echo 'Connected successfully'; mysql_close(); ?>