Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Database
- {
- private static $this_instance;
- private static $this_handle;
- private function __construct($handle)
- {
- }
- public static function create($handle)
- {
- if(!self::$this_instance)
- {
- global $db;
- self::$this_handle = mysql_connect($db[$handle]['host'],$db[$handle]['user'],$db[$handle]['password']);
- mysql_select_db($db[$handle]['dbname'],self::$this_handle);
- self::$this_instance = 1;
- }
- return self::$this_handle;
- }
- }
Add Comment
Please, Sign In to add comment