aztech Posted January 1, 2011 Posted January 1, 2011 Hi everybody, I wrote this php script for connect to db: <?php $connessione=pg_connect("host=heliohost.org port=5432 dbname=aztech_prova user=aztech_fuma password=**********") or die("Database non disponibile"); ?> But it doesn't work, I receive this error: Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "65.19.143.2", user "aztech_fuma", database "aztech_prova", SSL off in /home1/aztech/public_html/registrazione.php on line 2 Database non disponibile Could you explain me the problem? Thank you Quote
jje Posted January 1, 2011 Posted January 1, 2011 Although I have no experience of PostgreSQL, try replacing host=heliohost.org with host=stevie.heliohost.org Quote
Guest Geoff Posted January 1, 2011 Posted January 1, 2011 Are you developing on your local computer, or heliohost? If you are connecting from your local computer, the connection might not work. Quote
aztech Posted January 1, 2011 Author Posted January 1, 2011 Although I have no experience of PostgreSQL, try replacing host=heliohost.org with host=stevie.heliohost.org I already tried you're method but it still doesn't work. Are you developing on your local computer, or heliohost? If you are connecting from your local computer, the connection might not work. I tried to work online, it's the same. Quote
jje Posted January 1, 2011 Posted January 1, 2011 Try... <?php $connessione=pg_connect("host=localhost dbname=aztech_prova user=aztech_fuma password=**********") or die("Database non disponibile"); ?> Sorry - I have no experience with PostgreSQL but I'll do the best I can. note: that code will only work if the script is on your heliohost website, not remotely Quote
aztech Posted January 2, 2011 Author Posted January 2, 2011 Try... <?php $connessione=pg_connect("host=localhost dbname=aztech_prova user=aztech_fuma password=**********") or die("Database non disponibile"); ?> Sorry - I have no experience with PostgreSQL but I'll do the best I can. note: that code will only work if the script is on your heliohost website, not remotely Thank you very very much!!! Now it works!!!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.