11-21-2007, 01:00 PM
|
#3 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
But, I've used this in DB.php:
php Code:
<?php/** |||||||||||||||||||||||||||||||||||||||||| |||| @author Tanax |||| @copyright 2007 |||||||||||||||||||||||||||||||||||||||||| **/ function __autoload ($database) { include_once('databases/' . $database . '.php'); } class DB { public static $DB; public static function getInstance ($type) { if(! is_object(self:: $DB)) { $type = strtolower($type); switch($type) { case 'mysql': self:: $DB = new DBmysql (); break; case 'mssql': self:: $DB = new DBmssql (); break; default: self:: $DB = new DBmysql (); break; } } return self:: $DB; } } ?>
So it should create the object for me... :S
|
|
|
|