daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 27th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class DB {
  2.  
  3.    var $conn;
  4.    var $config;
  5.    var $isConnected;
  6.    var $lastQuery;
  7.    var $lastError;
  8.    
  9.    function DB($host='',$dbase='', $user='',$pass='',$enc='') {
  10.    
  11.       $this->config['host'] = $host;
  12.       $this->config['dbase'] = $dbase;
  13.       $this->config['user'] = $user;
  14.       $this->config['pass'] = $pass;
  15.       $this->config['enc'] = $enc;
  16.      
  17.       return (true);
  18.    }
  19.  
  20.  
  21.    # Connect to db
  22.    function connect() {
  23.    
  24.       $host = $this->config['host'];
  25.       $db = $this->config['dbase'];
  26.       $user = $this->config['user'];
  27.       $pass = $this->config['pass'];
  28.  
  29.       if ( !$this->conn = ibase_connect($host . ':' . $db, $user, $pass, $enc) ) {
  30.        $this->isConnected = 0;
  31.        $this->lastError = 'Connection problem';
  32.        return (false);
  33.       } else {
  34.        $this->isConnected = 1;
  35.        return(true);
  36.       }
  37.  
  38.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top