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 ibm db2 函数 executes an sql statement directlyphp ingres 函数 send an sql query to ingresphp maxdb 函数 execute an sql queryphp mssql 函数 executes a stored procedure on a ms sql server databasephp sqlite 函数 register an aggregating udf for use in sql statementsphp sqlite 函数 registers a regular user defined function for use in sql statementsphp sqlite 函数 escapes a string for use as a query parameterphp 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 函数 execute a query that does not prefetch and buffer all dataphp sqlsrv 函数 prepares and executes a queryphp mysqli stmt executes a prepared queryphp mysqlnduhpreparedstatement executes a prepared queryphp 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 returns the number of database rows that were changed or inserted or deleted by the most recent sql statementphp sqlite3 executes a result less query against a given databasephp sqlite3 executes an sql queryphp sqlite3 executes a query and returns a single result
关注编程学问公众号