Horde_Db_Adapter_Base::selectAll PHP Method

selectAll() public method

Returns an array of record hashes with the column names as keys and column values as values.
public selectAll ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
return array
    public function selectAll($sql, $arg1 = null, $arg2 = null)
    {
        $rows = array();
        $result = $this->select($sql, $arg1, $arg2);
        if ($result) {
            foreach ($result as $row) {
                $rows[] = $row;
            }
        }
        return $rows;
    }

Usage Example

示例#1
0
文件: Metar.php 项目: horde/horde
 /**
  * Perform DB query to obtain list of airport codes.
  *
  * @return array  An array of station information. Each entry contains:
  *   - icao: The ICAO identifier of the location.
  *   - name: The human readable name of the station.
  *   - country: The country the station is located in (if available).
  *
  * @throws  Horde_Service_Weather_Exception
  */
 protected function _getLocations()
 {
     if (empty($this->_db)) {
         return array();
     }
     $sql = 'SELECT icao, name, state, municipality, country FROM ' . $this->_tableName . ' ORDER BY country';
     try {
         return $this->_db->selectAll($sql);
     } catch (Horde_Exception $e) {
         throw new Horde_Service_Weather_Exception($e);
     }
 }
All Usage Examples Of Horde_Db_Adapter_Base::selectAll