Re: Using PostgreSQL with PHP / Scope an Lifetime of $result
От | Luis H. |
---|---|
Тема | Re: Using PostgreSQL with PHP / Scope an Lifetime of $result |
Дата | |
Msg-id | 002601c36c03$2a621ac0$0301a8c0@bigbertha обсуждение исходный текст |
Ответ на | Using PostgreSQL with PHP / Scope an Lifetime of $result ("Martin Ziebart" <martin_ziebart@web.de>) |
Список | pgsql-novice |
After you execute the pg_exec, the results are stored in $query and no longer have any direct reference to the database. So you can close the connection and still work with the query. I would assume you can return the $query and continue to work on it as long as you'd like.
----- Original Message -----From: Martin ZiebartSent: Monday, August 25, 2003 5:07 PMSubject: [NOVICE] Using PostgreSQL with PHP / Scope an Lifetime of $resultHi !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@web.de remove NO_SPAM to get the email adress
В списке pgsql-novice по дате отправления: