Then open up a browser window and type yourdomainname.co.nz/databasetest.php
If the connection is successful you will receive a 'Database Connected successfully' message.
If the connection is not successful you will receive a 'Could not connect the database : Username or password incorrect' message. When this happens you must double check your DATABASE NAME, USER and PASSWORD. We recommend you change the password in cPanel first and test again. If still not successful then you must check that you have added the USER to the DATABSE in cPanel with full access rights (all boxes ticked).
mysql_connect('localhost', 'your_db_user', 'your_db_password') or die('Could not connect the database : Username or password incorrect');
mysql_select_db('your_db_name') or die ('No database found');
echo 'Database Connected successfully';