Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class database
- {
- public $connected = false;
- public $hostname = "127.0.0.1";
- public $port = "666";
- public $username = "root";
- public $password = "xAYEs5=9";
- public $database = "zaphotel";
- private $con;
- public function connect()
- {
- global $core;
- global $cfg;
- $this->con = mysql_connect($this->hostname . ":" . $this->port, $this->username, $this->password) or $core->sysError(mysql_error());
- mysql_select_db($this->database, $this->con) or $core->sysError(mysql_error());
- $this->connected = true;
- }
- public function dbQuery($query)
- {
- global $core;
- return mysql_result(mysql_query($query));
- }
- public function dbAssoc($query)
- {
- global $core;
- $result = @mysql_fetch_assoc($query);
- return $result;
- }
- public function dbResult($query)
- {
- global $core;
- $result = @mysql_result($query, 0);
- return $result;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement