Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Do we have a valid database connection and have we selected a database?
- public function databaseSelected()
- {
- if(!$this->isConnected()) return false;
- $result = mysql_list_tables($this->name, $this->db);
- return is_resource($result);
- }
- public function connect()
- {
- $this->db = @mysql_connect($this->host, $this->username, $this->password) or $this->notify('Failed connecting to the database with the supplied connection details. Please check the details are correct and your MySQL user has permissions to access this database.<br/><br/>(host: '.$this->host.', user: '.$this->username.', pass: ********)');
- if($this->db === false) return false;
- mysql_select_db($this->name, $this->db) or $this->notify(); if($this->isConnected())
- {
- mysql_set_charset('UTF-8', $this->db);
- $this->query("SET NAMES utf8");
- }
- return $this->isConnected();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement