Jump to content

PostgreSQL database


aztech

Recommended Posts

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

Link to comment
Share on other sites

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. :(

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!!!! :D

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...