Using PostgreSQL with PHP / Scope an Lifetime of $result

From: "Martin Ziebart" <martin_ziebart(at)web(dot)de>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Using PostgreSQL with PHP / Scope an Lifetime of $result
Date: 2003-08-25 21:07:38
Message-ID: 002801c36b4c$ea6ffc40$0a00a8c0@WINXP1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi !

The following PHP-Code:
>> $conn=pg_connect ($conn_string);

>> $query=pg_exec ($conn, $sql_statement); // it's pg_query for PHP >4.2.0

>> pg_close ($conn);

My question:

What's the scope and lifetime of the $query Resource ? Can I still use it after calling pg_close ? or do i have to copy all my rows, fields and stuff before calling pg_close.

Suppose I'd use the mentioned Code in a function wich will return $query as a result. Will the return value of the function still be valid and usable ?

Thanks for your help !

Martin

please reply to: mNO_SPAMartin_ziebart(at)web(dot)de remove NO_SPAM to get the email adress

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message CoL 2003-08-25 21:09:37 Re: Way to tell what SQL is currently running?
Previous Message Tom Lane 2003-08-25 20:53:18 Re: Number of rows in a table