sqlite_fetch_array

SQLiteResult::fetch

SQLiteUnbuffered::fetch

(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)

sqlite_fetch_array -- SQLiteResult::fetch -- SQLiteUnbuffered::fetchFetches the next row from a result set as an array

说锟斤拷

sqlite_fetch_array ( resource $result [, int $result_type = SQLITE_BOTH [, bool $decode_binary = TRUE ]] ) : array

锟斤拷锟斤拷锟斤拷锟斤拷锟� (method):

SQLiteResult::fetch ([ int $result_type = SQLITE_BOTH [, bool $decode_binary = TRUE ]] ) : array
SQLiteUnbuffered::fetch ([ int $result_type = SQLITE_BOTH [, bool $decode_binary = TRUE ]] ) : array

Fetches the next row from the given result handle. If there are no more rows, returns FALSE, otherwise returns an associative array representing the row data.

锟斤拷锟斤拷

result

The SQLite result resource. This parameter is not required when using the object-oriented method.

result_type

锟斤拷选锟斤拷 result_type 锟斤拷锟斤拷锟斤拷锟杰筹拷锟斤拷锟斤拷锟揭撅拷锟斤拷锟斤拷锟截碉拷锟斤拷锟斤拷锟斤拷伪锟斤拷锟斤拷锟斤拷锟绞癸拷锟� SQLITE_ASSOC 锟斤拷锟斤拷锟斤拷毓锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷侄危锟斤拷锟斤拷锟� SQLITE_NUM 锟斤拷锟斤拷锟斤拷锟斤拷锟街碉拷锟斤拷锟斤拷锟�SQLITE_BOTH 锟斤拷同时锟斤拷锟截癸拷锟斤拷锟斤拷锟斤拷值锟斤拷锟斤拷锟斤拷SQLITE_BOTH 锟角此猴拷锟斤拷锟斤拷默锟斤拷值锟斤拷

decode_binary

锟斤拷 decode_binary 锟斤拷锟斤拷锟斤拷锟斤拷为 TRUE锟斤拷默锟斤拷值锟斤拷时锟斤拷PHP 锟斤拷锟斤拷锟斤拷锟叫╋拷锟� sqlite_escape_string() 锟斤拷锟斤拷锟侥讹拷锟斤拷锟斤拷锟斤拷锟捷★拷通锟斤拷应锟斤拷锟斤拷锟斤拷值为锟斤拷默锟斤拷值锟斤拷锟斤拷锟斤拷要锟斤拷锟斤拷锟斤拷使锟斤拷 SQLlite 锟斤拷应锟矫筹拷锟斤拷锟斤拷锟斤拷锟斤拷锟捷斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

Returns an array of the next row from a result set; FALSE if the next position is beyond the final row.

锟斤拷 SQLITE_ASSOC 锟斤拷 SQLITE_BOTH 锟斤拷锟截碉拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 sqlite.assoc_case 锟斤拷锟斤拷选锟斤拷锟街碉拷锟斤拷锟斤拷锟叫⌒达拷锟�

锟斤拷锟斤拷

Example #1 Procedural example

<?php
$dbhandle 
sqlite_open('sqlitedb');
$query sqlite_query($dbhandle'SELECT name, email FROM users LIMIT 25');
while (
$entry sqlite_fetch_array($querySQLITE_ASSOC)) {
    echo 
'Name: ' $entry['name'] . '  E-mail: ' $entry['email'];
}
?>

Example #2 Object-oriented example

<?php
$dbhandle 
= new SQLiteDatabase('sqlitedb');

$query $dbhandle->query('SELECT name, email FROM users LIMIT 25'); // buffered result set
$query $dbhandle->unbufferedQuery('SELECT name, email FROM users LIMIT 25'); // unbuffered result set

while ($entry $query->fetch(SQLITE_ASSOC)) {
    echo 
'Name: ' $entry['name'] . '  E-mail: ' $entry['email'];
}
?>

锟轿硷拷