Guest User

Untitled

a guest
May 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class Database
  2. {
  3. private static $this_instance;
  4. private static $this_handle;
  5.  
  6. private function __construct($handle)
  7. {
  8. }
  9.  
  10. public static function create($handle)
  11. {
  12. if(!self::$this_instance)
  13. {
  14. global $db;
  15. self::$this_handle = mysql_connect($db[$handle]['host'],$db[$handle]['user'],$db[$handle]['password']);
  16. mysql_select_db($db[$handle]['dbname'],self::$this_handle);
  17. self::$this_instance = 1;
  18. }
  19.  
  20. return self::$this_handle;
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment