i already purchase a web hosting and a domaine to my portfolio,but the connection with the contact form and the database is not set on in my Cpanel,i m trying to test the connection by simple file . i don t know whats the problem i guess "mysqli" is not set on ,i checked the connection information (user,pass...) they are correct,any suggestions ?
Sponsor hosting : namecheap.com
<?php
$host = 'localhost';
$user = 'user1';
$pass = 'pass1';
$db = 'db1';
$con = mysqli_connect($host, $user, $pass,$db);
if($con)
{
print 'CONNECTED';
}
else
{
print 'NOT CONNECTED';
}
?>
to debug and check what happened , use this :
else
{
print 'NOT CONNECTED';
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
instead of :
else
{
print 'NOT CONNECTED';
}