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


PHP sqlite_seek函數代碼示例

本文整理匯總了PHP中sqlite_seek函數的典型用法代碼示例。如果您正苦於以下問題:PHP sqlite_seek函數的具體用法?PHP sqlite_seek怎麽用?PHP sqlite_seek使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: seek

 /**
  * Seek
  *
  * @param   int offset
  * @return  bool success
  * @throws  rdbms.SQLException
  */
 public function seek($offset)
 {
     if (!sqlite_seek($this->handle, $offset)) {
         throw new SQLException('Cannot seek to offset ' . $offset);
     }
     return TRUE;
 }
開發者ID:melogamepay,項目名稱:xp-framework,代碼行數:14,代碼來源:SQLiteResultSet.class.php

示例2: rewind

 function rewind()
 {
     if (isset($this->queryId) && is_resource($this->queryId) && sqlite_num_rows($this->queryId)) {
         if (sqlite_seek($this->queryId, 0) === false) {
             $this->connection->_raiseError();
         }
     } elseif (!$this->queryId) {
         $query = $this->query;
         if (is_array($this->sort_params)) {
             if (preg_match('~(?<=FROM).+\\s+ORDER\\s+BY\\s+~i', $query)) {
                 $query .= ',';
             } else {
                 $query .= ' ORDER BY ';
             }
             foreach ($this->sort_params as $field => $order) {
                 $query .= $this->connection->quoteIdentifier($field) . " {$order},";
             }
             $query = rtrim($query, ',');
         }
         if ($this->limit) {
             $query .= ' LIMIT ' . $this->limit . ' OFFSET ' . $this->offset;
         }
         $this->queryId = $this->connection->execute($query);
     }
     $this->key = 0;
     $this->next();
 }
開發者ID:knevcher,項目名稱:limb,代碼行數:27,代碼來源:lmbSqliteRecordSet.class.php

示例3: reset

 function reset()
 {
     if ($this->row > 0) {
         sqlite_seek($this->id, 0);
     }
     $this->row = -1;
     return TRUE;
 }
開發者ID:BackupTheBerlios,項目名稱:k4bb,代碼行數:8,代碼來源:sqlite.php

示例4: seek

 public function seek($offset)
 {
     if ($this->offsetExists($offset) && sqlite_seek($this->_result, $offset)) {
         $this->_current_row = $this->_internal_row = $offset;
         return true;
     } else {
         return false;
     }
 }
開發者ID:google2013,項目名稱:myqeecms,代碼行數:9,代碼來源:Result.class.php

示例5: seek

 /**
  * @see ResultSet::seek()
  */
 public function seek($rownum)
 {
     // MySQL rows start w/ 0, but this works, because we are
     // looking to move the position _before_ the next desired position
     if (!@sqlite_seek($this->result, $rownum)) {
         return false;
     }
     $this->cursorPos = $rownum;
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:nodin-svn,代碼行數:13,代碼來源:SQLiteResultSet.php

示例6: seek

 public function seek($offset)
 {
     if ($this->offsetExists($offset) and sqlite_seek($this->_result, $offset)) {
         // Set the current row to the offset
         $this->_current_row = $this->_internal_row = $offset;
         return TRUE;
     } else {
         return FALSE;
     }
 }
開發者ID:ametsuramet,項目名稱:belajar_kohana,代碼行數:10,代碼來源:result.php

示例7: result

 function result($query_id = 0, $row = 0, $field = NULL)
 {
     if ($query_id) {
         if ($row != 0) {
             @sqlite_seek($query_id, $row);
         }
         return @current(@sqlite_current($query_id));
     } else {
         return false;
     }
 }
開發者ID:BACKUPLIB,項目名稱:minimanager-1,代碼行數:11,代碼來源:sqlite.php

示例8: fetch

 /**
  * Fetches the next result
  * @return array
  */
 function fetch()
 {
     if ($row = sqlite_fetch_array($this->query)) {
         return $row;
     } else {
         if ($this->size() > 0) {
             sqlite_seek($this->query, 0);
             return false;
         } else {
             return false;
         }
     }
 }
開發者ID:jensz12,項目名稱:PHP-Last.fm-API,代碼行數:17,代碼來源:SqliteResult.php

示例9: sqliteAdapter

 /**
  * Constructor method for the adapter.  This constructor implements the setting of the
  * 3 required properties for the object.
  * 
  * @param resource $d The datasource resource
  */
 function sqliteAdapter($d)
 {
     parent::RecordSetAdapter($d);
     // grab all of the rows
     $fieldcount = sqlite_num_fields($d);
     $ob = "";
     $fc = pack('N', $fieldcount);
     if (sqlite_num_rows($d) > 0) {
         sqlite_seek($d, 0);
         while ($line = sqlite_fetch_array($d, SQLITE_NUM)) {
             //Write array flag + length
             $ob .= "\n" . $fc;
             $to = count($line);
             for ($i = 0; $i < $to; $i++) {
                 //Type everything as a string since this is sqlite
                 $value = $line[$i];
                 $os = $this->_directCharsetHandler->transliterate($value);
                 //string flag, string length, and string
                 $len = strlen($os);
                 if ($len < 65536) {
                     $ob .= "" . pack('n', $len) . $os;
                 } else {
                     $ob .= "\f" . pack('N', $len) . $os;
                 }
             }
         }
     }
     // grab the number of fields
     // loop over all of the fields
     for ($i = 0; $i < $fieldcount; $i++) {
         // decode each field name ready for encoding when it goes through serialization
         // and save each field name into the array
         $this->columnNames[$i] = $this->_directCharsetHandler->transliterate(sqlite_field_name($d, $i));
     }
     $this->numRows = sqlite_num_rows($d);
     $this->serializedData = $ob;
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:43,代碼來源:sqliteAdapter.php

示例10: fetchSpecificRow

 function fetchSpecificRow($num, $type = "", $stack = 0)
 {
     if ($type == "") {
         $type = SQLITE_BOTH;
     } else {
         if ($type == "num") {
             $type = SQLITE_NUM;
         } else {
             if ($type == "assoc") {
                 $type = SQLITE_ASSOC;
             }
         }
     }
     if (!$this->result[$stack]) {
         log_message("DB: called fetchSpecificRow[{$stack}] but result is false");
         return;
     }
     sqlite_seek($this->result[$stack], $num);
     return @sqlite_fetch_array($this->result[$stack], $type);
 }
開發者ID:guohuadeng,項目名稱:stampApp,代碼行數:20,代碼來源:sqlite.php

示例11: fetchInto

 /**
  * Fetch a row and insert the data into an existing array.
  *
  * Formating of the array and the data therein are configurable.
  * See DB_result::fetchInto() for more information.
  *
  * @param resource $result    query result identifier
  * @param array    $arr       (reference) array where data from the row
  *                            should be placed
  * @param int      $fetchmode how the resulting array should be indexed
  * @param int      $rownum    the row number to fetch
  *
  * @return mixed DB_OK on success, null when end of result set is
  *               reached or on failure
  *
  * @see DB_result::fetchInto()
  * @access private
  */
 function fetchInto($result, &$arr, $fetchmode, $rownum = null)
 {
     if ($rownum !== null) {
         if (!@sqlite_seek($this->result, $rownum)) {
             return null;
         }
     }
     if ($fetchmode & DB_FETCHMODE_ASSOC) {
         $arr = @sqlite_fetch_array($result, SQLITE_ASSOC);
         if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
             $arr = array_change_key_case($arr, CASE_LOWER);
         }
     } else {
         $arr = @sqlite_fetch_array($result, SQLITE_NUM);
     }
     if (!$arr) {
         /* See: http://bugs.php.net/bug.php?id=22328 */
         return null;
     }
     if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
         /*
          * Even though this DBMS already trims output, we do this because
          * a field might have intentional whitespace at the end that
          * gets removed by DB_PORTABILITY_RTRIM under another driver.
          */
         $this->_rtrimArrayValues($arr);
     }
     if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
         $this->_convertNullArrayValuesToEmpty($arr);
     }
     return DB_OK;
 }
開發者ID:bantudevelopment,項目名稱:polysmis,代碼行數:50,代碼來源:sqlite.php

示例12: seek

 /**
  * Moves internal result pointer.
  * @param resource $resultSet
  * @param int $offset
  * @return bool
  * @throws DriverException
  */
 public function seek($resultSet, $offset)
 {
     if ($this->unbuffered) {
         throw new DriverException('Cannot seek on unbuffered result.');
     }
     return @sqlite_seek($resultSet, $offset);
 }
開發者ID:smasty,項目名稱:neevo,代碼行數:14,代碼來源:sqlite2.php

示例13: resultSeek

 /**
  * Move internal result pointer
  *
  * Moves the pointer within the query result to a specified location, or
  * to the beginning if nothing is specified.
  *
  * @param resource $result    Resultset
  * @param integer  $rowNumber Row number
  * 
  * @return boolean
  */
 public function resultSeek($result, $rowNumber)
 {
     return sqlite_seek($result, $rowNumber);
 }
開發者ID:jr-ewing,項目名稱:phpMyFAQ,代碼行數:15,代碼來源:Sqlite.php

示例14: sql_result

function sql_result($result, $row, $field = 0)
{
    $check = sqlite_seek($result, $row);
    if ($check === false) {
        output_error("SQL Error: " . sql_error(), E_USER_ERROR);
        return false;
    }
    $trow = sqlite_fetch_array($result);
    $retval = $trow[$field];
    return $retval;
}
開發者ID:BackupTheBerlios,項目名稱:idb,代碼行數:11,代碼來源:sqlite.php

示例15: seek

 function seek($offset)
 {
     return sqlite_seek($this->id, $offset);
 }
開發者ID:BackupTheBerlios,項目名稱:k4bb-svn,代碼行數:4,代碼來源:sqlite.php


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