Forum und email

sqlite_unbuffered_query

SQLiteDatabase->unbufferedQuery

(No version information available, might be only in CVS)

SQLiteDatabase->unbufferedQuery — Execute a query that does not prefetch and buffer all data

설명

resource sqlite_unbuffered_query ( resource $dbhandle , string $query [, int $result_type [, string &$error_msg ]] )
resource sqlite_unbuffered_query ( string $query , resource $dbhandle [, int $result_type [, string &$error_msg ]] )

Object oriented style (method):

SQLiteDatabase
SQLiteUnbuffered unbufferedQuery ( string $query [, int $result_type [, 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.

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 or FALSE on failure.

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