PYTHON SQLite3::query

is this article helpful?
|
Python replacement for PHP's SQLite3::query [ edit | history ]
db.execute(query)

PHP SQLite3::query

PHP original manual for SQLite3::query [ show | php.net ]

SQLite3::query

(PHP 5 >= 5.3.0)

SQLite3::queryExecutes an SQL query

Description

public SQLite3_result SQLite3::query ( string $query )

Executes an SQL query, returning an SQLite3_result object if the query returns results.

Parameters

query

The SQL query to execute.

Return Values

Returns an SQLite3_result object if the query returns results. Otherwise, returns TRUE if the query succeeded, FALSE on failure.

Examples

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);
}
?>