Always use this over the sqlite_fetch_* functions if possible as it's much faster.
(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)
sqlite_unbuffered_query -- SQLiteDatabase::unbufferedQuery — Execute a query that does not prefetch and buffer all data
$dbhandle
, string $query
[, int $result_type
= SQLITE_BOTH
[, string &$error_msg
]] )$query
, resource $dbhandle
[, int $result_type
= SQLITE_BOTH
[, string &$error_msg
]] )객체 기반 형식 (method):
$query
[, int $result_type
= SQLITE_BOTH
[, string &$error_msg
]] )sqlite_unbuffered_query() is identical to sqlite_query() except that the result that is returned is a sequential forward-only result set that can only be used to read each row, one after the other.
This function is ideal for generating things such as HTML tables where you only need to process one row at a time and don't need to randomly access the row data.
Note:
Functions such as sqlite_seek(), sqlite_rewind(), sqlite_next(), sqlite_current(), and sqlite_num_rows() do not work on result handles returned from sqlite_unbuffered_query().
dbhandle
The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.
query
The query to be executed.
Data inside the query should be properly escaped.
result_type
선택적인 result_type
인수는 반환하는 배열이 어떤 형식일지에 대한 대한 상수를 받습니다.
SQLITE_ASSOC
를 사용하면 연상배열(이름 필드)로 반환합니다.
SQLITE_NUM
은 수치배열(순차적인 필드 번호)를 반환합니다.
SQLITE_BOTH
는 연상 및 수치를 동시에 반환합니다.
SQLITE_BOTH
가 기본값입니다.
error_msg
The specified variable will be filled if an error occurs. This is specially important because SQL syntax errors can't be fetched using the sqlite_last_error() function.
Note: (MySQL 같은) 다른 데이터베이스 확장과 호환성을 유지하기 위하여 두가지 다른 형식의 문법을 지원합니다. 권장하는 방식은
dbhandle
인수를 함수의 첫번째 인수로 사용하는 것입니다.
Returns a result handle실패 시 FALSE
를 반환합니다.
sqlite_unbuffered_query() returns a sequential forward-only result set that can only be used to read each row, one after the other.
버전 | 설명 |
---|---|
5.1.0 |
Added the error_msg parameter
|
Always use this over the sqlite_fetch_* functions if possible as it's much faster.