Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2.         /* MySQL Object class by nano. */
  3.  
  4.         class DataControl extends ObjectControl () {
  5.  
  6.  
  7.                 private $this->linkId;
  8.                 public $this->errors[];
  9.  
  10.                 public function __construct($host="localhost", $database=NULL, $user=NULL, $pass=NULL, $port=3306) {
  11.                         $this->host = $host;
  12.                         $this->database = $database;
  13.                         $this->user = $user;
  14.                         $this->pass = $pass;
  15.                 }
  16.  
  17.                 private function connectToDb() {
  18.                         if ($this->linkId = mysql_connect($this->host, $this->user, $this->pass) {
  19.                                 if (mysql_select_db($this->database) {
  20.                                         return true;
  21.                                 } else {
  22.                                         $this->errors[] = mysql_error();
  23.                                 }
  24.                         } else {
  25.                                 $this->errors[] = mysql_error();
  26.                         }
  27.                 }
  28.  
  29.                 public function Save() { }
  30.  
  31.                 public function Delete() { }
  32.  
  33.         }
  34.  
  35.         class ObjectControl {
  36.  
  37.                 public function __construct($fields[] = $fieldName => $fieldType, $dataControl) {
  38.                         $this->dataControl = DataControl->construct()
  39.                 }
  40.  
  41.                 // Some GET/SET functions...
  42.  
  43.         }
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement