Using MyPHPadmin database for password storage


I am following an online tutorial that uses XAMPP and Apache to connect a database using MyPHPadmin and MySQL for user registration, usernames and passwords. All stored on the database for later login.

The tutorial says input the IP address of the website into the first part followed by Username, Password and Database name.

$con=mysqli_connect(‘IP address’,‘Username’.‘Password’) or die(“Unable to connect”);
mysqli_select_db(“database name”,$con);

Since I am using a free webpage how do I input the IP address into the first part of the sqli_connect command? What is the IP address, or what should I use instead?



Technically, the first argument for mysqli_connect is called host. This can be an IP address, or a domain name which points to that IP address.

With our hosting, you’ll need to use the domain name. In the MySQL Databases section, you’ll find your “database hostname” which is the thing to enter there (probably something like

Please do note that you can only connect to this database from within your hosting account with us. It’s not possible to connect directly to the database from code running on another host or on your own computer.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.