|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-02-13 12:10 UTC] thies@php.net
[2001-02-13 12:10 UTC] thies@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
Assuming that both pg_connect() and pg_close() are called inside a function, and then pg_connect() is called again from the main program, the next error will occur: "Warning: 1 is not a valid PostgreSQL link resource in ..." examples: 1. NG function foo() { $conn = pg_connect(...); ... pg_close($conn); } foo(); # calls pg_connect() and pg_close() $conn = pg_connect(...); # returns invalid connection id 2. OK $conn = 0; # defines $conn as a global variable function foo() { global $conn; $conn = pg_connect(...); ... pg_close($conn); } foo(); # calls pg_connect() and pg_close() $conn = pg_connect(...); # returns VALID connection id