コード例 #1
0
ファイル: CustomPdo.php プロジェクト: secteofilandia/ieducar
 /**
  * Move o ponteiro e retorna uma registro do result set PDOStatment.
  *
  * @return mixed|bool Retorna FALSE em caso de erro
  * @see intranet/include/clsBancoSQL_#ProximoRegistro()
  */
 public function ProximoRegistro()
 {
     $row = $this->_rs->fetch($this->_fetchMode);
     if (is_array($row)) {
         array_walk_recursive($row, array($this, '_decodeUtf8'));
     }
     return $this->_row = $row;
 }
コード例 #2
0
ファイル: SQLQuery.php プロジェクト: andela-gjames/PotatoORM
 /**
  * Runs an execute and fetch query to the database.
  *
  * @param PDOStatment $STH prepared PDO statement
  * @param  array       [$bindParams         = null] parameters to bind to the exeucute statement
  *
  * @return array of fetched data
  */
 private static function fetch($STH, $bindParams = null)
 {
     //Check to see ff binding parameters needed, add if needed
     $bindParams === null ? $STH->execute() : $STH->execute($bindParams);
     //Create empty array to place result
     $result = array();
     //Loop through and place each row into result array
     while ($row = $STH->fetch()) {
         $result[] = $row;
     }
     //Return result
     return $result;
 }