Update version.php to 3.3.0
[isso.git] / DbMySqlI.php
index e0dba3ac3fd769acc052358ac6ab03761e11e327..008a10252d554abb74633293e2f9c73997891db0 100644 (file)
@@ -2,11 +2,11 @@
 /*=====================================================================*\
 || ###################################################################
 || # Blue Static ISSO Framework
-|| # Copyright ©2002-[#]year[#] Blue Static
+|| # Copyright (c)2005-2009 Blue Static
 || #
 || # This program is free software; you can redistribute it and/or modify
 || # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| # the Free Software Foundation; version 2 of the License.
 || #
 || # This program is distributed in the hope that it will be useful, but
 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 \*=====================================================================*/
 
 /**
-* MySQLi Database Layer (DbMySqlI.php)
-*
-* @package     ISSO
-*/
+ * MySQLi Database Layer (DbMySqlI.php)
+ *
+ * @package    ISSO
+ */
 
-require_once('ISSO/Db.php');
+require_once(ISSO . '/Db.php');
 
 /**
-* MySQLi Database Layer
-*
-* This framework is a function wrapper for MySQLi functions so we can have
-* better error reporting and query reporting.
-*
-* @author              Blue Static
-* @copyright   Copyright ©2002 - [#]year[#], Blue Static
-* @version             $Revision$
-* @package             ISSO
-* 
-*/
+ * MySQLi Database Layer
+ *
+ * This framework is a function wrapper for MySQLi functions so we can have
+ * better error reporting and query reporting.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2009, Blue Static
+ * @package            ISSO
+ * 
+ */
 class BSDbMySqlI extends BSDb
 {
-       // ###################################################################
        /**
-       * Wrapper: mysql_connect
-       */
+        * Wrapper: mysql_connect
+        */
        protected function _connect($server, $user, $password, $database)
        {
-               return mysqli_connect($server, $user, $password, $database);
+               return @mysqli_connect($server, $user, $password, $database);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_query
-       */
+        * Wrapper: mysql_query
+        */
        protected function _query($string)
        {
                return mysqli_query($this->dblink, $string);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_escape_string
-       */
+        * Wrapper: mysql_escape_string
+        */
        protected function _escapeBinary($binary)
        {
                return mysqli_real_escape_string($this->dblink, $binary);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql(_real)_escape_string
-       */
+        * Wrapper: mysql(_real)_escape_string
+        */
        protected function _escapeString($string)
        {
                return mysqli_real_escape_string($this->dblink, $string);
        }
        
-       // ###################################################################
        /**
-       * Not supported: unescape binary string
-       */
+        * Not supported: unescape binary string
+        */
        protected function _unescapeBinary($string)
        {
                return $string;
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_assoc
-       */
-       protected function _fetchAssocArray($result)
+        * Wrapper: mysql_insert_id
+        */
+       protected function _insertId()
        {
-               return mysqli_fetch_assoc($result);
+               return mysqli_insert_id($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_row
-       */
-       protected function _fetchRowArray($result)
+        * Wrapper: mysql_affected_rows
+        */
+       protected function _affectedRows($result)
        {
-               return mysqli_fetch_row($result);
+               return mysqli_affected_rows($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_object
-       */
-       public function _fetchObject($result)
+        * Starts a database transaction
+        */
+       public function begin()
        {
-               return mysqli_fetch_object($result);
+               $this->query("START TRANSACTION");
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_free_result
-       */
-       protected function _freeResult($result)
+        * Reverts a transaction back to a given savepoint
+        */
+       public function rollback()
        {
-               mysqli_free_result($result);
+               $this->query("ROLLBACK");
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_insert_id
-       */
-       protected function _insertId()
+        * Commits a database transaction
+        */
+       public function commit()
        {
-               return mysqli_insert_id($this->dblink);
+               $this->query("COMMIT");
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_num_rows
-       */
-       protected function _numRows($result)
+        * Returns the error number
+        *
+        * @return      integer Error number
+        */
+       public function _errorNumber()
        {
-               return mysqli_num_rows($result);
+               return mysqli_errno($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_affected_rows
-       */
-       protected function _affectedRows($result)
+        * Returns the error string
+        *
+        * @return      string  Error string
+        */
+       public function _errorString()
        {
-               return mysqli_affected_rows($this->dblink);
+               return mysqli_error($this->dblink);
        }
-       
-       // ###################################################################
+}
+
+/**
+ * Database Result
+ *
+ * This class holds result information for a database result
+ *
+ * @author             rsesek
+ * @copyright  Copyright (c)2005 - 2009, Blue Static
+ * @package            ISSO
+ *
+ */
+class BSDbMySqlIResult extends BSDbResult
+{
        /**
-       * Starts a database transaction
-       */
-       public function begin()
+        * Wrapper: mysql_fetch_assoc
+        */
+       protected function _fetchAssocArray($result)
        {
-               $this->query("START TRANSACTION");
+               return mysqli_fetch_assoc($result);
        }
        
-       // ###################################################################
        /**
-       * Reverts a transaction back to a given savepoint
-       */
-       public function rollback()
+        * Wrapper: mysql_fetch_row
+        */
+       protected function _fetchRowArray($result)
        {
-               $this->query("ROLLBACK");
+               return mysqli_fetch_row($result);
        }
        
-       // ###################################################################
        /**
-       * Commits a database transaction
-       */
-       public function commit()
+        * Wrapper: mysql_fetch_object
+        */
+       public function _fetchObject($result)
        {
-               $this->query("COMMIT");
+               return mysqli_fetch_object($result);
        }
        
-       // ###################################################################
        /**
-       * Returns the error number
-       *
-       * @return       integer Error number
-       */
-       public function _errorNumber()
+        * Wrapper: mysql_free_result
+        */
+       protected function _freeResult($result)
        {
-               return mysqli_errno($this->dblink);
+               mysqli_free_result($result);
        }
        
-       // ###################################################################
        /**
-       * Returns the error string
-       *
-       * @return       string  Error string
-       */
-       public function _errorString()
+        * Wrapper: mysql_num_rows
+        */
+       protected function _numRows($result)
        {
-               return mysqli_error($this->dblink);
+               return mysqli_num_rows($result);
        }
 }
 
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
 ?>
\ No newline at end of file