Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2. class MySQL
  3. {
  4.     private $con;
  5.     public function __contruct($host="Default",$username="Default",$password="Default")
  6.     {
  7.     if($host == "Default" && $username == "Default" && $password == "Default")
  8.     {
  9.         include("config.php");
  10.     }
  11.     $this->con = mysql_connect($host,$username,$password);
  12.     }
  13.     public function chooseDB($db)
  14.     {
  15.     mysql_select_db($db, $this->con);
  16.     }
  17.     public function query($query)
  18.     {
  19.     return mysql_query("SELECT * FROM Persons");
  20.     }
  21.     public function __destruct()
  22.     {
  23.     mysql_close($this->con);
  24.     }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement