PHP 5.4.36 Released

sqlite_single_query

SQLiteDatabase::singleQuery

(PHP 5 < 5.4.0, PECL sqlite >= 1.0.1)

sqlite_single_query -- SQLiteDatabase::singleQuery Esegue una query e restituisce o un array per ogni singola colonna o il valore della prima riga

Descrizione

array sqlite_single_query ( resource $db , string $query [, bool $first_row_only [, bool $decode_binary ]] )

Stile orientato agli oggetti (metodo):

public array SQLiteDatabase::singleQuery ( string $query [, bool $first_row_only [, bool $decode_binary ]] )
Avviso

Questa funzione, al momento non è documentata; è disponibile soltanto la lista degli argomenti.

add a note add a note

User Contributed Notes 2 notes

up
0
oohall AT gmail DOT comMERCIAL
6 years ago
The previous note by franp at free dot fr appears to be incorrect, some cursory testing showed that DELETE FROM and INSERT INTO queries worked fine so other queries which do not return data should also work. However, if you're looking for a drop in replacement for sqlite_query(), try sqlite_unbuffered_query() as it appears to only execute the first query if more than one is given.
up
0
franp at free dot fr
10 years ago
AFAIK, you cannot use sqlite-single-query for all kind of SQL queries.
If you are lazy and thought you could safely copy-paste your :
<?php $result = $db->sqlite-single-query($sSQL); ?>
straight from one query to the other, whatever is the query as long as it has only one line, you are wrong.

Apparently, sqlite-single-query is limited to queries that return data, that is to SELECT queries.

<?php
$sSQL 
= "DELETE FROM atoms WHERE ID = '8';";

// The following won't work :
$result = $db->singleQuery($sSQL);

// But the following will :
$result = $db->query($sSQL);
?>
To Top