Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem?

From: Terry Mackintosh <terry(at)terrym(dot)com>
To: Robert Chalmers <robert(at)chalmers(dot)com(dot)au>
Cc: pgsql-admin(at)postgreSQL(dot)org, php <php3(at)lists(dot)php(dot)net>
Subject: Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem?
Date: 1998-12-27 14:09:29
Message-ID: Pine.LNX.3.95.981227085138.30930A-100000@terry1.acun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Robert

On Sun, 27 Dec 1998, Robert Chalmers wrote:

> Since I have updated, either php3, or pgsql, is refusing a connection from the
> php3 engine to the database.
> ....
> <html>
> <body>
> <?php $database = pg_connect("host=nanguo dbname=ecotourism port=5432"); ?>

I use PHP 3 all the time, and have never seen the above syntax, is that
PHP/FI syntax? so that may be your problem. Here is how I do it:

if ( !($database = pg_connect("localhost","5432","","","ecotourism")))
{// NOTE the use of 'localhost', if it's all on 1 box, thats all you need.
echo "Bad connection to database!<p>Sorry<p>.\n";
}
else
{
// Good to go!
}

> <br>
> <?php if ($database):
> echo "Database Connection.";
> else:
> echo "Database NOT Connected.";
> endif;
> ?>
> <br>
> </body>
> </html>

Hope that helps
Terry Mackintosh <terry(at)terrym(dot)com> http://www.terrym.com
sysadmin/owner Please! No MIME encoded or HTML mail, unless needed.

Proudly powered by R H Linux 4.2, Apache 1.3, PHP 3, PostgreSQL 6.4
-------------------------------------------------------------------
Success Is A Choice ... book by Rick Patino, get it, read it!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Terry Mackintosh 1998-12-27 17:40:51 Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem? (fwd)
Previous Message Robert Chalmers 1998-12-27 09:07:11 Re: [PHP3] pgsql + php3 expert needed. Can you solve this problem?