Using MyPHPadmin database for password storage

Hello,

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?

Thanks.

3 Likes

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 sql123.epizy.com).

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.

2 Likes

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