SQLite3::query

(PHP 5 >= 5.3.0, PHP 7)

SQLite3::queryExecutes an SQL query

说明

public SQLite3::query ( string $query ) : SQLite3Result

Executes an SQL query, returning an SQLite3Result object. If the query does not yield a result (such as DML statements) the returned SQLite3Result object is not really usable. Use SQLite3::exec() for such queries instead.

参数

query

The SQL query to execute.

返回值

Returns an SQLite3Result object, 或者在失败时返回 FALSE.

范例

Example #1 SQLite3::query() example

<?php
$db 
= new SQLite3('mysqlitedb.db');

$results $db->query('SELECT bar FROM foo');
while (
$row $results->fetchArray()) {
    
var_dump($row);
}
?>

相关文章
php cubrid 函数 get result of next query when executing multiple sql statementsphp ingres 函数 send an unbuffered sql query to ingresphp maxdb 函数 executes a prepared queryphp mssql 函数 send ms sql queryphp sqlite 函数 execute a query against a given database and returns an arrayphp sqlite 函数 returns the number of rows that were changed by the most recent sql statementphp sqlite 函数 executes a result less query against a given databasephp sqlite 函数 executes a query against a given database and returns a result handlephp sqlite 函数 executes a query and returns either an array for one single column or the value of the first rowphp sqlite pdo registers an aggregating user defined function for use in sql statementsphp sqlite pdo registers a user defined function for use as a collating function in sql statementsphp sdo das relational 函数 executes an sql query passed as a prepared statement with a list of values to substitute for placeholders and return the results as a normalised data graphphp sdo das relational 函数 executes a given sql query against a relational database and returns the results as a normalised data graphphp sqlite3 registers a php function for use as an sql aggregate functionphp sqlite3 registers a php function for use as an sql collating functionphp sqlite3 registers a php function for use as an sql scalar functionphp sqlite3 executes a result less query against a given databasephp sqlite3 executes an sql queryphp sqlite3 executes a query and returns a single resultphp sqlite3stmt get the sql of the statement
关注编程学问公众号