Re: [phplib] CHOOSE OF DATABASE From: Kristian Köhntopp (kk <email protected>)
Date: 03/15/01

Michal ROMAN wrote:
> But where can I do It? It must be dooing before calling function
> page_open(...)?

In page_open(), one database class is being used to
establish a database connection for Session and Auth.
You have to choose one.

Your application may use many different databases. Best
thing would be to create a DB_Sql subclass with a
different constructor, like for example

DB_Variable extends DB_Sql
  function DB_Variable($user, $pass, $host, $db) {
    $this->User = $user;
    $this->Password = $pass;
    $this->Database = $db;
    $this->Host = $host
  }
}

or something along these lines. You could then

  $db = DB_Variable("kris", "test", "localhost", "test_test");

as you see fit.

Kristian

-- 
Kristian Köhntopp, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>