mysqliInterface.php

Go to the documentation of this file.
00001 <?php
00002 
00003 class mysqliInterface {
00004     private $resource = null;
00005     private $cursor = null;
00006 
00007     public function __construct () {
00008     }
00009 
00010     public function connect ($host, $user, $pass, $db) {
00011         $this->resource = @mysqli_connect($host, $user, $pass, $db);
00012         return $this->resource;
00013     }
00014 
00015     public function connectError () {
00016         return mysqli_connect_error();
00017     }
00018 
00019     public function setCharset ($charset) {
00020         $this->resource->set_charset($charset);
00021     }
00022 
00023     public function query ($sql) {
00024         $this->cursor = mysqli_query($this->resource, $sql);
00025         return $this->cursor;
00026     }
00027 
00028     public function errno () {
00029         return mysqli_errno($this->resource);
00030     }
00031     
00032     public function error () {
00033         return mysqli_error($this->resource);
00034     }
00035 
00036     public function getEscaped($text) {
00037         return mysqli_real_escape_string($this->resource, (string) $text);
00038     }
00039 
00040     public function getNumRows ($cur=null) {
00041         return mysqli_num_rows( $cur ? $cur : $this->cursor );
00042     }
00043 
00044     public function getAffectedRows () {
00045         return mysqli_affected_rows($this->resource);
00046     }
00047 
00048     public function insertid() {
00049         return mysqli_insert_id($this->resource);
00050     }
00051 
00052     public function getVersion() {
00053         return mysqli_get_server_info($this->resource);
00054     }
00055 
00056     public function getFetchFunc() {
00057         return 'mysqli_fetch_';
00058     }
00059 
00060     public function freeResultSet ($cur=null) {
00061         mysqli_free_result($cur ? $cur : $this->cursor);
00062     }
00063 
00064     public function multiQuery ($sql) {
00065         return mysqli_multi_query($this->resource, $sql);
00066     }
00067 
00068     public function storeResult () {
00069         return mysqli_store_result($this->resource);
00070     }
00071 
00072     public function nextResult () {
00073         return mysqli_next_result($this->resource);
00074     }
00075 
00076 }

Generated on Wed May 14 13:01:56 2008 for ALIRO by  doxygen 1.5.5