At 07:21 6-6-01, you wrote:
>$dbconn1 = @pg_connect ("host=$dbhost dbname=$dbname user=$dbuser
>password=$dbpasswd");
>
>Edit /usr/local/lib/php.ini and make sure persistent connections is
>turned off.
This will work, as long as the machine is up, but pgsql isn't. However, if the
machine isn
> $port=9939;
> $host=\"210.111.1.10\";
> pg=pg_connect($port,$host);
> ?>
> But problem is if somebody suddenly switch off
> the server(210.111.1.10), the script hangs on.
> How would my script check that host is open before connecting?
A simple ping maybe? :-)
Csaba
__
This mess
By Php scripts I am connecting to database SERVER:
It works good enough.
But problem is if somebody suddenly switch off
the server(210.111.1.10), the script hangs on.
How would my script check that host is open before connecting?
---(end of broadcast)--
Frist ,How in script could I Ping?
Second,from command line Ping also hangs.
Csaba Bobak wrote:
> > > $port=9939;
> > $host=\"210.111.1.10\";
> > pg=pg_connect($port,$host);
> > ?>
>
> > But problem is if somebody suddenly switch off
> > the server(210.111.1.10), the script hangs on.
> > How w
> $port=9939;
> $host=\"210.111.1.10\";
> pg=pg_connect($port,$host);
> ?>
Hehe, don't escape the quotes around your variables.
Here's a function I use to connect to the database.
$dbhost = '210.111.1.10';
$dbuser = 'postgres';
$dbpasswd = 'meep';
$dbname = 'your_db';
function establish_db_co
By Php scripts I am connecting to database SERVER:
But problem is if somebody suddenly switch off
the server(210.111.1.10), the script hangs on.
How would my script check that host is open before connecting?
---(end of broadcast)---
TIP 6: Have