Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database {
- private $_db;
- private $_host;
- private $_dbname;
- private $_user;
- public function __construct($host, $dbname, $user, $password = '') {
- if (empty($host) OR empty($dbname) OR empty($user)) {
- return false;
- }
- $this->_db = new PDO('mysql:host=' . $host . ';dbname=' . $dbname, $user, $password);
- $this->_host = $host;
- $this->_dbname = $dbname;
- $this->_user = $user;
- }
- // Checks if a given table already exists
- public function tableExists($table) {...}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement