當前位置: 首頁>>代碼示例>>PHP>>正文


PHP resource::data_seek方法代碼示例

本文整理匯總了PHP中resource::data_seek方法的典型用法代碼示例。如果您正苦於以下問題:PHP resource::data_seek方法的具體用法?PHP resource::data_seek怎麽用?PHP resource::data_seek使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在resource的用法示例。


在下文中一共展示了resource::data_seek方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: seek

 /**
  * Seek to a specific record of the result set
  *
  * @param int $row The index of the row to position to (zero-based)
  *
  * @return void
  */
 public function seek($row)
 {
     switch ($this->mode) {
         case "mysql":
             $this->result->data_seek($row);
             break;
         case "postgres":
         case "redshift":
             pg_result_seek($this->result, $row);
             break;
         case "odbc":
             # The odbc driver doesn't support seeking, so we fetch specific rows in getNextRow(), and here all we need to do is set the current position instance variable
             break;
         case "sqlite":
             $this->result->reset();
             for ($i = 0; $i < $row; $i++) {
                 $this->result->fetchArray();
             }
             break;
         case "mssql":
             mssql_data_seek($this->result, $row);
             break;
     }
     $this->position = $row;
 }
開發者ID:ian-Tr,項目名稱:le-huard,代碼行數:32,代碼來源:Result.php

示例2: seek

 /**
  * set the result pointer to offset
  * 
  * @param int $pos
  * @return boolean
  */
 public function seek($pos)
 {
     if (!$this->result) {
         return false;
     }
     if ($pos >= $this->numRows()) {
         $pos = 0;
     }
     if ($this->result->data_seek($pos)) {
         $this->pos = $pos;
         return true;
     } else {
         return false;
     }
 }
開發者ID:gpuenteallott,項目名稱:rox,代碼行數:21,代碼來源:db_statement_mysqli.lib.php

示例3: mysqlDataSeek

 /**
  * @param resource|ResultWrapper $res
  * @param int $row
  * @return mixed
  */
 protected function mysqlDataSeek($res, $row)
 {
     return $res->data_seek($row);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:9,代碼來源:DatabaseMysqli.php

示例4: seek

 public function seek($row)
 {
     if (is_object($this->handle)) {
         return $this->handle->data_seek($row);
     }
 }
開發者ID:normann,項目名稱:sapphire,代碼行數:6,代碼來源:MySQLDatabase.php

示例5: rewind

 /**
  * Rewind the result set
  *
  * @param resource $res
  * @return boolean
  */
 public function rewind($res)
 {
     if ($res and $res->num_rows > 0) {
         return $res->data_seek(0);
     }
     return true;
 }
開發者ID:djeraseit,項目名稱:quickbooks-php,代碼行數:13,代碼來源:Mysqli.php


注:本文中的resource::data_seek方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。