Home >Backend Development >PHP Tutorial >PHP connects to mysql database
PHP connects to mysql database
<?php $dbhost = 'localhost:3306'; $dbuser = 'root'; $dbpass = 'root'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { echo 'Connect failure'; } echo 'Connected successfully'; mysql_close(); ?>