当前位置: 首页>>代码示例>>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;未经允许,请勿转载。