當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。