Changeset 1685

Show
Ignore:
Timestamp:
01/06/2008 03:49:44 AM (12 months ago)
Author:
PugFish
Message:

Updating Database driver interface for new prepared statement syntax

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/drivers/Database.php

    r1642 r1685  
    2525         * 
    2626         * @param  string $sql 
    27          * @return Mysql_Result 
     27         * @return Database_Result 
    2828         */ 
    2929        abstract public function query($sql); 
     
    151151                $prefix = ($num_likes == 0) ? '' : $type; 
    152152 
    153                 $match = (substr($match, 0, 1) == '%' OR substr($match, (strlen($match)-1), 1) == '%')  
    154                        ? $this->escape_str($match)  
     153                $match = (substr($match, 0, 1) == '%' OR substr($match, (strlen($match)-1), 1) == '%') 
     154                       ? $this->escape_str($match) 
    155155                       : '%'.$this->escape_str($match).'%'; 
    156156 
     
    171171                $prefix = ($num_likes == 0) ? '' : $type; 
    172172 
    173                 $match = (substr($match, 0, 1) == '%' OR substr($match, (strlen($match)-1), 1) == '%')  
    174                        ? $this->escape_str($match)  
     173                $match = (substr($match, 0, 1) == '%' OR substr($match, (strlen($match)-1), 1) == '%') 
     174                       ? $this->escape_str($match) 
    175175                       : '%'.$this->escape_str($match).'%'; 
    176176 
     
    238238 
    239239        /** 
    240          * Initiates a prepared statement. 
     240         * Creates a prepared statement. 
    241241         * 
    242242         * @param  string $sql 
    243          * @param  string $label 
    244          * @return boolean 
    245          */ 
    246         abstract public function stmt_prepare($sql = '', $label); 
    247  
    248         /** 
    249          * Executes a prepared statement. 
    250          * 
    251          * @param  string $sql 
    252          * @param  string $label 
    253          * @return boolean 
    254          */ 
    255         abstract public function stmt_execute($vals = array(), $label); 
    256  
    257         /** 
    258          * Destroys a prepared statement. 
    259          * 
    260          * @param  string $sql 
    261          * @param  string $label 
    262          * @return boolean 
    263          */ 
    264         abstract public function stmt_clear($label); 
     243         * @return Database_Stmt 
     244         */ 
     245        abstract public function stmt_prepare($sql = ''); 
    265246 
    266247        /** 
     
    446427         * @param  bool  $object 
    447428         * @param  mixed $type 
    448          * @return object 
     429         * @return Database_Result 
    449430         */ 
    450431        public function result($object = TRUE, $type = FALSE);