Changeset 137 in subversion


Ignore:
Timestamp:
Feb 19, 2006 12:39:26 PM (7 years ago)
Author:
roundcube
Message:

Added fetch_array method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_db.inc

    r100 r137  
    3636 * @author     David Saez Padros <david@ols.es> 
    3737 * @author     Thomas Bruederli <roundcube@gmail.com> 
    38  * @version    1.14 
     38 * @version    1.16 
    3939 * @link       http://pear.php.net/package/DB 
    4040 */ 
     
    305305    { 
    306306    $result = $this->_get_result($res_id); 
    307  
     307    return $this->_fetch_row($result, DB_FETCHMODE_ASSOC); 
     308    } 
     309 
     310 
     311  /** 
     312   * Get an index array for one row 
     313   * If no query handle is specified, the last query will be taken as reference 
     314   * 
     315   * @param  number  Optional query handle identifier 
     316   * @return mixed   Array with col values or FALSE on failure 
     317   * @access public 
     318   */ 
     319  function fetch_array($res_id=NULL) 
     320    { 
     321    $result = $this->_get_result($res_id); 
     322    return $this->_fetch_row($result, DB_FETCHMODE_ORDERED); 
     323    } 
     324 
     325 
     326  /** 
     327   * Get co values for a result row 
     328   * 
     329   * @param  object  Query result handle 
     330   * @param  number  Fetch mode identifier 
     331   * @return mixed   Array with col values or FALSE on failure 
     332   * @access private 
     333   */ 
     334  function _fetch_row($result, $mode) 
     335    { 
    308336    if (DB::isError($result)) 
    309337      { 
     
    313341      } 
    314342                          
    315     return $result->fetchRow(DB_FETCHMODE_ASSOC); 
    316     } 
    317  
     343    return $result->fetchRow($mode); 
     344    } 
     345     
    318346 
    319347  /** 
Note: See TracChangeset for help on using the changeset viewer.