SHARE
TWEET

Untitled

a guest Mar 20th, 2016 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private static $_connectionLink = null;
  2. private static $_connectionErrors = null;
  3.  
  4. public function __construct() {
  5.     if (empty(self::$_connectionLink)) {
  6.         self::connect();
  7.         $handle = fopen('connect.log','a');
  8.         fputs($handle,"----------- NEW connect ".date('Y-m-d H:i')."----------- n");
  9.         fclose($handle);
  10.     }
  11. }
  12.     private static function connect() {
  13.     $host = 'localhost';
  14.     $user = 'user';
  15.     $password = 'pass';
  16.     $dbName = 'dbname';
  17.  
  18.     self::$_connectionLink = @mysqli_connect($host,$user,$password,$dbName);
  19.     if (!mysqli_connect_errno()) {
  20.         mysqli_set_charset(self::$_connectionLink, 'utf8');
  21.     } else {
  22.  
  23.     }
  24. }
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