RE: [PHP-DB] Fatal error: Call to undefined function: pg_connect( ) in .....
| From: | Hutchins, Richard | Date: | Fri, 19 Jul 2002 15:11:54 +0000 |
| Subject: | RE: [PHP-DB] Fatal error: Call to undefined function: pg_connect( ) in ..... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20657@lists.php.net to get a copy of this message | ||
From one newbie to another, here are a couple random thoughts:
1. Is the database to which you are trying to connect located on another
server? If so, you may need to provide the "hostname" parameter in the
connection string. With Apache, you may even have to supply the hostname
"localhost" if it's on the same server anyway. Not sure.
2. Have you implemented a user name and/or password to the database to which
you are trying to connect? If so, you probably need to supply the "username"
and "password" parameters in the connection string.
If I was experiencing what you have described, this is where I would start
troubleshooting. I use MySQL, not PostgreSQL, that way the db support is
built-in so forgive me if this note is not all that helpful.
-----Original Message-----
From: Vincent [mailto:supremehawk@yahoo.com]
Sent: Thursday, July 18, 2002 9:38 PM
To: php-general@lists.php.net; php-db@lists.php.net
Subject: [PHP-DB] Fatal error: Call to undefined function: pg_connect()
in .....
Hi, I'm a newbie here. I don't know what went wrong.
I've tried searching for solutions and can't find any.
How come pg_connect() isn't defined? Should I include
any header files or something in php?
Here's my code:
<HTML>
<HEAD>
<TITLE>Example PHP Querying</TITLE>
<BODY>
<?php
$conn = pg_connect("dbname=phpdb");
if (!$conn) {
echo "Unable to connect to database<br>";
} else
print "Connected";
?>
</BODY>
</HTML>
I've tried installing Apache's rpm and Php's rpm. I'm
running on RedHat Linux 7.3. apache_1.3.23-11.i386.rpm
and php-4.1.2-7.rpm. Then, it still gives me the error
message. So, I tried the gz version using
apache_1.3.26.tar.gz and php-4.2.1.tar.gz. Nothing
works. I've tried looking into the php.ini files,
adding extension to pgsql.so.
Have any of you encountered this problem before?
__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php