I am trying to create some very basic php code that will let me know If i have successfully connected to my MySQL database. Using MySQLi, I have found out that this is the best way of creating a connection:
$connection = mysqli_connect(host, username, password, dbname);
and then I saw that you can test to see if you are connected by using an if statement like this:
if(!$connection){
echo "connection failed"
}
else{
echo "Successful connection"
}
I believe what I am having the most difficult time trying to understand is the parameters for the mysqli_connect function. I understand that I need the username, password, and database name from MySQL, however I am fluttering at what needs to go where it says "host". Is anyone familiar with connecting to a MySQL database that could help me out?