If the page gives you code that uses localhost, that's probably part of the problem.
Make sure any mention of localhost is replaced with whatever your database hostname is (Ex: mysql.example.com).
Like this line from that page:
$con = mysql_connect("localhost","yourDatabaseUsername","yourDatabasePassword");
I noticed the page tells you to update what's in bold... but doesn't have localhost in bold, so make sure that's corrected.
Other than that, you'll probably have to be more specific about the problems you're having for people here to be able to offer advice.
Maximum savings promo code: MaxSavingsAtDH