Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. class Database {
  4.  
  5.  
  6. private $_db;
  7. private $_host;
  8. private $_dbname;
  9. private $_user;
  10.  
  11. public function __construct($host, $dbname, $user, $password = '') {
  12.  
  13. if (empty($host) OR empty($dbname) OR empty($user)) {
  14. return false;
  15. }
  16. $this->_db = new PDO('mysql:host=' . $host . ';dbname=' . $dbname, $user, $password);
  17. $this->_host = $host;
  18. $this->_dbname = $dbname;
  19. $this->_user = $user;
  20.  
  21. }
  22.  
  23. // Checks if a given table already exists
  24. public function tableExists($table) {...}
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement