Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2.  
  3.     class database
  4.     {
  5.         public $connected = false;
  6.         public $hostname = "127.0.0.1";
  7.         public $port = "666";
  8.         public $username = "root";
  9.         public $password = "xAYEs5=9";
  10.         public $database = "zaphotel";
  11.         private $con;
  12.        
  13.        
  14.         public function connect()
  15.         {
  16.             global $core;
  17.             global $cfg;
  18.            
  19.             $this->con = mysql_connect($this->hostname . ":" . $this->port, $this->username, $this->password) or $core->sysError(mysql_error());
  20.             mysql_select_db($this->database, $this->con) or $core->sysError(mysql_error());
  21.             $this->connected = true;
  22.         }
  23.         public function dbQuery($query)
  24.         {
  25.             global $core;
  26.            
  27.             return mysql_result(mysql_query($query));
  28.         }
  29.         public function dbAssoc($query)
  30.         {
  31.             global $core;
  32.            
  33.             $result = @mysql_fetch_assoc($query);
  34.             return $result;
  35.         }
  36.         public function dbResult($query)
  37.         {
  38.             global $core;
  39.            
  40.             $result = @mysql_result($query, 0);
  41.             return $result;
  42.         }
  43.     }
  44.    
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement