473,322 Members | 1,232 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.

Unable to connect to PostgreSql database.

Hi All,

I am not able to connect to PostgreSql databse,while I am using "pg_connect()" function . My usage is as follows,
[PHP]
pg_connect("host=localhost port=5432 dbname=mydb ");
[/PHP]

but If I am deleting the "host" and adding the "user" it is getting connected. But some tables I am not able to access.

[PHP]pg_connect(" port=5432 dbname=mydb user=root");[/PHP]

Pl. do reply me the whether changes in php ( php.conf ) or PostgrSql ( " postgrsql.conf & pg_hba.conf" ) configuration file's are required . or it is due to some other cause.
Jun 23 '07 #1
3 1803
pbmods
5,821 Expert 4TB
Heya, dhillarun.

What do you get when you echo pg_result_error()?
Jun 23 '07 #2
Heya, dhillarun.

What do you get when you echo pg_result_error()?
Actually, I am not able to connect to database itself.

As I am not able to create connection, the connection handle is not having proper value.

So, I am not able to successfully execute pg_result_error() (i.e.,displays nothing).
Jul 2 '07 #3
pbmods
5,821 Expert 4TB
Heya, dhillarun.

Good thing I read your OP, huh? :[

Make sure you have error reporting turned on, and see what PHP has to say about it.
Jul 2 '07 #4

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

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
1
by: Rick Hickerson | last post by:
I can't get PHP to connect to DB2 on the same server. I'm running both Apache/PHP and DB2 on Mandrake Linux 9.2. I didn't compile PHP; just installed what appear to be the appropriate RPMs (I...
0
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres...
8
by: Carlos Ojea Castro | last post by:
Hello: I'm trying to use kylix3 and postgresql 7.4.1. My distro was Debian Woody, kernel 2.20. I make the link /usr/local/pgsql/lib/libpq.so pointing to libpq.so.2.2 and connection with my...
4
by: charles.leviton | last post by:
Hi all, I am running on Win XP. I have installed Apache 2.2. Works fine. I have installed php-4.4.4-Win32 manually. Apache to php connection is working fine, I tested a couple of trivial php...
4
by: newladder | last post by:
Hi all, Iam struck with one of the problem with postgres. Please help me out.... Iam trying to connect to connect to postgres database on remote machine with the IP address 10.2.1.4. Iam unable...
21
by: Steve | last post by:
I moved my database from one server to another SQL server. I did a backup and restore of the database. I can connect to the database on server A from my asp.net app but when I try to connect to my...
1
by: Markw | last post by:
Hi folks I think I've got a variable problem but not 100% sure. Background: I took the CMS example from chapter 6 in "Build your Own Database Driven Website Using PHP&MySQL" and have attempted to...
3
by: Harmony504 | last post by:
HELP! Setup: PHP5.2.5, IIS 5.1, XP, AS/400 (DB/400 or DB2) I am trying to connect to a DB2 database from my computer. I installed DB2 Connect and set up the ODBC Driver in the Data Source...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.