X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3F68FD1C9F7 for ; Tue, 5 Aug 2003 17:51:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27853-02 for ; Tue, 5 Aug 2003 14:50:19 -0300 (ADT) Received: from seapdc01.PNTS (ip63.c216.blk1.bel.nwlink.com [209.20.216.63]) by svr1.postgresql.org (Postfix) with ESMTP id F272DD1C9DB for ; Tue, 5 Aug 2003 14:51:26 -0300 (ADT) Received: from busbydev (BUSBY-DEV [10.0.0.17]) by seapdc01.PNTS with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id PRCQ9KGS; Tue, 5 Aug 2003 11:08:02 -0700 Message-ID: <009601c35b79$48810010$1100000a@busbydev> Reply-To: "David Busby" From: "David Busby" To: Subject: PHP Connections Date: Tue, 5 Aug 2003 10:44:56 -0700 Organization: Pacific Northwest Ticket Service MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200308/4 X-Sequence-Number: 2181 List, Which way to connect is better for my scripts? a global $db = pg_connect('asdfasdfasdfasdf'); and every function can have global $db; at the top? or like this? function db_handle() { return pg_connect('asdfasdfasdfasdfadsf'); } and everyplace needed use `db_handle()` so I call pg_exec like $rs = pg_exec(db_handle(),"select everything from everywhere")); So does that db_handle() make a new connection each time? I'm really looking for the way to optimise my connection usage. David Busby Systems Engineer busby@pnts.com