Re: Auth class

From: Date: Fri, 23 Nov 2001 12:47:35 +0000
Subject: Re: Auth class
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-538@lists.php.net to get a copy of this message
On Fri, 23 Nov 2001 11:20:31 +0100, LIMBOURG Arnaud wrote: >I've been wondering somtehing about the auth class, does it always open up a >new connection to the DB on every call ? You can use the following syntax: <?php require_once "DB.php"; require_once "Auth/Auth.php"; $dbh = DB::Connect("mysql://user:password@host/db"); $auth = new Auth("DB", $dbh); ?> As you can see, the Auth class can use the database connection that has been specified in the 5th line. => You can use this database connection in your whole application and there is no need to open a new connection for the Auth class. - Martin -- Martin Jansen, <mail@martin-jansen.de> http://www.martin-jansen.de/

« previous php.pear.general (#538) next »