Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2.         /* IRC channel spy by nano */
  3.  
  4.         class MySql($host="localhost", $database=NULL, $user=NULL, $pass=NULL, $port=3306) {
  5.  
  6.                 function __construct() {
  7.                         $this->host = $host;
  8.                         $this->database = $database;
  9.                         $this->user = $user;
  10.                         $this->pass = $pass;
  11.                         private $this->linkId;
  12.                         public  $this->errors[];
  13.                 }
  14.  
  15.                 function connectToDb() {
  16.                         if ($this->linkId = mysql_connect($this->host, $this->user, $this->pass) {
  17.                                 if (mysql_select_db($this->database) {
  18.                                         return true;
  19.                                 } else {
  20.                                         $this->errors[] = mysql_error();
  21.                                 }
  22.                         } else {
  23.                                 $this->errors[] = mysql_error();
  24.                         }
  25.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement