How to connect to '000webhost.com' MySQL Server

Hi,
I am quite new to PHP and MySQl and making my progress. I have installed a MySQL server on my PC and wrote the PHP scripts for storing and retrieving the data from my MySQL Server. Everything works fine on my localhost [PC].

For the information I have used mysqli_connect(); to connect to my localhost MySQL Server.

Now my question is how can I connect to the ‘000webhost.com’ MySQL Server, I used the same username = ‘au2951***’ and password = ‘*******’ which has been sent during the registration and the host name = ‘mysql8.000webhost.com’.

Like: mysql_connect(‘mysql8.000webhost.com’,‘au2951***’, ‘*****’);

But I am getting the error as shown below:

" Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘au2951***’@‘1.2.3.4’ (using password: YES) in /home/au2951***/public_html/mailinglist/php/addemail.php on line 15 "

It would be really helpful if any one have an idea of where I am going wrong.

Thanks
Rakeen

The following is an example showing my DB connection script:

$conn = mysql_connect(“mysql#.000webhost.com”, “a3367xxx_test”,"******") or die(mysql_error());
mysql_select_db(“a3367xxx_test”, $conn);

If you are using mysqli_connect(), the function should include also db_name as shown below:

$conn = mysqli_connect(“mysql#.000webhost.com”, “a3367xxx_test”,"******", “a3367xxx_test”) or die(mysql_error());

The above code was written based on the following image:

Hi Grace1004,
thank you very much for the information. That really helped me.
Rakeen