Warning: Supplied argument is not a valid PostgreSQL link resource

From: "Jan Gravgaard" <jan(at)klog(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: Warning: Supplied argument is not a valid PostgreSQL link resource
Date: 2003-02-28 11:36:40
Message-ID: 3e5f49c3$0$19098$ba624c82@nntp02.dk.telia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there

I get the above mentioned warning when I execute php that contacts the
postgre database.

I use the following functions to connect to db

Some of the text is in danish :-)

function aabn_forbindelse_og_vaelgdb() {
$dbcon = pg_connect("host=XXX port=5432 dbname=XXX user=XXX
password=XXX");
if (!$dbcon) {
echo "Kunne ikke oprette en forbindelse til PostGre databasen.";
}
return $dbcon;
}

function luk_forbindelse($dbcon) {
if(!pg_close($dbcon)) {
echo "Kunne ikke lukke forbindelsen til PostGre!";
}
}

function sql_spoerg($dbcon, $query)
{
$resultat = pg_exec($dbcon, $query);
if(!$resultat) {
echo "Kunne ikke udfre: <em>$query</em>";
}
}

function sql_spoerg_og_faa_svar($dbcon, $query)
{
$resultat = pg_exec($dbcon, $query);
$resultat_array = array();
if(!$resultat)
{
echo "Kunne ikke udfre: <em>$query</em>";
}
while($raekke = pg_fetch_array($resultat))
{
$resultat_array[] = $raekke;
}
return $resultat_array;
}

Anyone who knows whats wrong ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-02-28 14:51:45 views and multiple tables?
Previous Message vasanth madhu 2003-02-28 10:29:51