473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

connection statement

Hi
i am trying to connect postgres database using php.my database name is DB username=GPME and password=secret.I tried the pg_connect() using host=localhost parameter also.The following error occurs.

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Database "DB,user=GPME,password=secret" does not exist in the system catalog. . in /var/www/html/GPME/technical.php on line 3
Warning: pg_close(): supplied argument is not a valid PostgreSQL link resource in /var/www/html/GPME/technical.php on line 10

My php version is 4.3.3 and pgsql version is 7.3.4.I tried this with mysql and it is working.Anyone please help me in this issue.
Aug 19 '08 #1
6 4627
rski
700 Expert 512MB
I think you use commas to separate all connections params, i'm not php specialist but maybe try to write connection string like that
Expand|Select|Wrap|Line Numbers
  1. pg_connect("host=localhost dbname=xxx password=xxx");
  2.  
Did you write connection string in that way?
Aug 19 '08 #2
Ye,I tried that.I tried to edit the pg_hba.conf file and removed the comment on the line
host all all 127.0.0.1 255.255.255.255 trust

too and restarted the postmaster service.

But still warning is there :

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Missing or erroneous pg_hba.conf file, see postmaster log for details . in
Warning: pg_close(): supplied argument is not a valid PostgreSQL link resource in /var/www/html/GPME/sample.php
Aug 21 '08 #3
rski
700 Expert 512MB
Ye,I tried that.I tried to edit the pg_hba.conf file and removed the comment on the line
host all all 127.0.0.1 255.255.255.255 trust

too and restarted the postmaster service.

But still warning is there :

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Missing or erroneous pg_hba.conf file, see postmaster log for details . in
Warning: pg_close(): supplied argument is not a valid PostgreSQL link resource in /var/www/html/GPME/sample.php
Oh, so you've got wrong pg_hba file. Look at it. Maybe there is somewere missing # (is a comment). Show here lines from pg_hba without leading #. Do you log events if so check postgres log.
Aug 21 '08 #4
I cudnt find any postmaster log files.One folder pg_xlog is there which lists
0000000000000000
Shall we create a log file or does it come with POstgresql itself.
Aug 21 '08 #5
rski
700 Expert 512MB
I cudnt find any postmaster log files.One folder pg_xlog is there which lists
0000000000000000
Shall we create a log file or does it come with POstgresql itself.
The place where log files are stored is defined in postgres.conf.
BTW what about not commented lines from pg_hba.conf .
Aug 21 '08 #6
Here is my ph_hba.conf file entries which is not leading by a #.That is the last line of the configuration file.

local all all ident sameuser
Aug 22 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Michelle A. | last post by:
I have created some forms in Visual Studio 2003 that will submit its information to and SQL database backend. Can someone give me an example (web link or code) so that I can add my SQL...
8
by: Pierson C | last post by:
I am developing on a website that is utilizing SQL Server 2000. Shortly after deploying the site, we began having timeout issues due to the max connections. 1st instinct was to diligently tidy...
0
by: jegray | last post by:
I am very much a beginner in dealing with connection statments. I am getting the following error: Microsoft OLE DB Provider for ODBC Drivers error '80004005' Data source name not found and no...
5
by: ernie.bornheimer | last post by:
Hello I have a script that works but it shouldn't, and I would like to know why. I originally wrote it with a statement to connect to the database, then there's a part to select the database,...
1
by: hal9000cr | last post by:
We are running into some problems with the execution of DB2 stored procedures when their isolation level is set to: set transaction isolation level READ UNCOMMITTED, READ WRITE; This is a web...
3
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
4
by: =?Utf-8?B?VGhlIERpZXA=?= | last post by:
I hope someone can help me. I'm try to find a C# statement that will let me connect to the new CRM 4.0. I have a UI that was programed in C# that was connected to SQL Server but I would now like...
2
by: freefony | last post by:
hi am kinda of new in programming and am building my first website but am encountering some problems . first my connection statement i connected like this : set...
3
Airslash
by: Airslash | last post by:
Hello, I've written my own TCPClient and TCPServer class components to handle traffic over the network between applications. When I test the components locally they work. In the local network...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.