Adilol

MySQLi

Feb 12th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.  
  3. class SQLi {
  4.     private $isConnected; //our boolean to determine whether Blizzard is connected
  5.     private $link; //our connection to the database
  6.     private $stmt; //variable for storing statements
  7.    
  8.    
  9.     public function __construct(){
  10.         global $_CONF;
  11.         global $core;
  12.        
  13.     $this->link = new mysqli ($_CONF['mysql']['host'],$_CONF['mysql']['user'],$_CONF['mysql']['password'],$_CONF['mysql']['db']); //open a connection to MySQL using the MySQLi wrapper
  14.     $isConnected = true; //set the connected bool to true
  15.     if($this->link->connect_error){ //if there is an error, excute this
  16.         $isConnected=false; //change bool to false
  17.         $core->Error("MySQL could not connect."); //output error
  18.        
  19.     }
  20.     }
  21.     public function Query($arg1,$arg2,$query){
  22.     $stmt = $this->link->prepare($query.$arg1."=?".$arg2."=?"); //prepare the query - stop injections
  23.     $stmt->bind_param();
  24.    
  25.     }
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment