Пример #1
0
 static function get_connection()
 {
     $host = "localhost";
     $user = "******";
     $password = "******";
     $base = "cash_statistic";
     //     if (empty(self::$connection)) {
     self::$connection = new mysqli($host, $user, $password, $base);
     if (self::$connection->connect_errno) {
         echo "Failed to connect to MySQL: (" . self::$connection->connect_errno . ") " . self::$connection->connect_error;
     }
     //    }
     return self::$connection;
 }