Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Database
- {
- private $db_host = '';
- private $db_user = '';
- private $db_pass = '';
- private $db_name = '';
- private $con = false;
- private $result = array();
- public function connect()
- {
- $this->db_host = Config::item('host');
- if(!$this->con)
- {
- $myconn = @mysql_connect($this->db_host, $this->db_user, $this->db_pass);
- if($myconn)
- {
- $seldb = @mysql_select_db($this->db_name, $myconn);
- if($seldb)
- {
- $this->con = true;
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- else
- {
- return true;
- }
- }
- }
Add Comment
Please, Sign In to add comment