So i am trying to have a php script connect to the database thats set up through Infinity Free.
The php script is simple and looks like this:
<?php
error_reporting(0);
$db_name = "database_name";
$mysql_user = "username";
$mysql_pass = "userpass";
$server_name = "server_domain";
$con = mysqli_connect($db_name, $mysql_user, $mysql_pass, $server_name);
if(!$con){
echo '{"message":"Unable to connect to the database."}';
}
echo "Connected";
?>
But this just doesnt even connect to the database. and the info of username database name and such are all correct.
I am unsure what is wrong. or whether i just dont have access to my database or something else entirely.
I am new to the scene and but i am willing to learn. Any help is appreciated