当前位置: 首页>>代码示例>>PHP>>正文


PHP PDOStatement::fetch方法代码示例

本文整理汇总了PHP中PDOStatement::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP PDOStatement::fetch方法的具体用法?PHP PDOStatement::fetch怎么用?PHP PDOStatement::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PDOStatement的用法示例。


在下文中一共展示了PDOStatement::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prefetch

 /**
  * Prefetch data
  */
 protected function prefetch()
 {
     if (!$this->currentFetched) {
         $this->currentData = $this->statement->fetch();
         $this->currentFetched = true;
     }
 }
开发者ID:fixin,项目名称:fixin,代码行数:10,代码来源:PdoStorageResult.php

示例2: next

 /**
  * @inheritDoc
  */
 public function next()
 {
     $this->cursorOffset++;
     // Fetching one row, located at the given offset in the result set
     // (This is what PDO::FETCH_ORI_ABS is for).
     $this->currentRow = $this->statement->fetch(\PDO::FETCH_ASSOC, \PDO::FETCH_ORI_ABS, $this->cursorOffset);
 }
开发者ID:adrilo,项目名称:spout-pdo-example,代码行数:10,代码来源:SingleFetchIterator.php

示例3: fetch

 /**
  * 获取单条数据
  * @param string $fetchStyle
  * @throws \HuiLib\Error\Exception
  * @return array|object
  */
 public function fetch()
 {
     if ($this->innerStatment == NULL) {
         throw new \HuiLib\Error\Exception('fetch必须先调用Query::query');
     }
     return $this->innerStatment->fetch($this->fetchStyle);
 }
开发者ID:ZhuJingfa,项目名称:HuiLib,代码行数:13,代码来源:Result.php

示例4: getLine

 function getLine()
 {
     if (!$this->_result) {
         return false;
     }
     return $this->_result->fetch(PDO::FETCH_ASSOC);
 }
开发者ID:zahar-g,项目名称:small_mvc_frmwrk,代码行数:7,代码来源:DataSource.php

示例5: fetchRow

 protected function fetchRow()
 {
     $this->current = $this->pdoStatement->fetch();
     if ($this->current) {
         $this->current->castInts();
         $this->current->setNew(false);
     }
 }
开发者ID:abcarroll,项目名称:DABL,代码行数:8,代码来源:QueryModelIterator.php

示例6: read

 /**
  * Reads a piece of input data and advance to the next one.
  * Implementations must return null at the end of the input data set.
  * @return mixed
  */
 public function read()
 {
     if (!$this->ready) {
         $this->init();
     }
     $data = $this->stmnt->fetch(\PDO::FETCH_ASSOC);
     return $data ? $data : null;
 }
开发者ID:aboutyou,项目名称:ayoc-batch,代码行数:13,代码来源:PDOReader.php

示例7: rewind

 /**
  * {@inheritdoc}
  */
 public function rewind()
 {
     if ($this->rewinded) {
         throw new InvalidMethodCallException('Cannot rewind a PDOStatement');
     }
     $this->current = $this->statement->fetch(\PDO::FETCH_ASSOC);
     $this->rewinded = true;
 }
开发者ID:sonata-project,项目名称:exporter,代码行数:11,代码来源:PDOStatementSourceIterator.php

示例8: next

 /** * @inheritDoc */
 public function next()
 {
     $this->key++;
     $this->result = $this->pdoStatement->fetch(\PDO::FETCH_OBJ, \PDO::FETCH_ORI_ABS, $this->key);
     if (false === $this->result) {
         $this->valid = false;
         return null;
     }
 }
开发者ID:shavez00,项目名称:groceryList,代码行数:10,代码来源:dbrowiterator.php

示例9: getDruaplNodeIdByWpPostId

 private function getDruaplNodeIdByWpPostId($wpPostId)
 {
     $this->getDruaplNodeIdByWpPostIdStatement->execute(array(':wp_post_id' => $wpPostId));
     $result = $this->getDruaplNodeIdByWpPostIdStatement->fetch(PDO::FETCH_ASSOC);
     if (!$result['nid']) {
         throw new Exception('No WP post ID: ' . $wpPostId);
     }
     return $result['nid'];
 }
开发者ID:hosszukalman,项目名称:wp2drupal,代码行数:9,代码来源:Comments.php

示例10: next

 /**
  * @inheritDoc
  */
 public function next()
 {
     $this->key++;
     $this->result = $this->pdoStatement->fetch(PDO::FETCH_OBJ, PDO::FETCH_ORI_ABS, $this->key);
     if ($this->result === FALSE) {
         $this->valid = FALSE;
         return NULL;
     }
 }
开发者ID:tfont,项目名称:skyfire,代码行数:12,代码来源:DbRowIterator.php

示例11: find

 /**
  * <b>O parametro deve ser um array atribuitivo apenas com Id da tabela</b>
  * 
  * @param array $Dados
  * @return array
  */
 public function find(array $Dados)
 {
     $Condicao = array_keys($Dados)[0];
     $Id = "{$Condicao} = :{$Condicao}";
     $sql = "SELECT * FROM {$this->Table} WHERE {$Id}";
     $this->Stmt = Conn::prepare($sql);
     $this->Stmt->execute($Dados);
     return $this->Stmt->fetch();
 }
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:15,代码来源:Business.class.php

示例12: next

 /**
  * Fetch next result
  * 
  * @param boolean|string $object Fetch as object
  * @return \stdClass
  */
 public function next($object = TRUE)
 {
     if ($object) {
         if ($object === TRUE) {
             return $this->stmt->fetchObject();
         }
         return $this->stmt->fetchObject($object);
     }
     return $this->stmt->fetch(\PDO::FETCH_ASSOC);
 }
开发者ID:sugatasei,项目名称:bredala,代码行数:16,代码来源:Result.php

示例13: fetch

 public function fetch()
 {
     $this->executeQuery();
     $rs = $this->statement->fetch(PDO::FETCH_ASSOC);
     if ($rs === null) {
         return false;
     } else {
         return $rs;
     }
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:10,代码来源:Statement.php

示例14: next

 /**
  * Advances the curesor in the statement
  * Closes the cursor if the end of the statement is reached
  */
 public function next()
 {
     $this->currentRow = $this->stmt->fetch(PDO::FETCH_NUM);
     $this->currentKey++;
     $this->isValid = (bool) $this->currentRow;
     if (!$this->isValid) {
         $this->closeCursor();
         if ($this->enableInstancePoolingOnFinish) {
             Propel::enableInstancePooling();
         }
     }
 }
开发者ID:norfil,项目名称:Propel2,代码行数:16,代码来源:OnDemandIterator.php

示例15: next

 public function next()
 {
     $this->current = null;
     if (($restore = $this->statement->fetch(\PDO::FETCH_ASSOC)) !== false) {
         $this->current = clone $this->storable;
         $this->current->schema()->validate($restore);
         if (isset($restore['guid'])) {
             $this->current->guid($restore['guid']);
             $this->storage->register($this->current);
         }
         $this->current->restore($restore);
     }
 }
开发者ID:edde-framework,项目名称:edde,代码行数:13,代码来源:DatabaseStorageIterator.php


注:本文中的PDOStatement::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。