SHARE
TWEET

Untitled

a guest Jun 5th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function con( $db, $realm=false ) {
  2.    
  3.     if(!$realm)
  4.     {
  5.         $user = $this->connections[$db]['user'];
  6.         $pass = $this->connections[$db]['pass'];
  7.         $host = $this->connections[$db]['host'];
  8.         $data = $this->connections[$db]['db_name'];
  9.     }
  10.     else{
  11.        
  12.         $user = $db['user'];
  13.         $pass = $db['pass'];
  14.         $host = $db['host'];
  15.         $data = $db['db_name'];
  16.         //echo $user."::".$pass."::".$host."::".$data;
  17.  
  18.     }
  19.    
  20.    
  21.     $con = mysql_connect( $host, $user, $pass ) or die('Error: cannot connect to database!');
  22.     $con = mysql_select_db( $data, $con );
  23.    
  24.     return $con;
  25.    
  26.     }
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