sqlite_single_query

(PHP 5)

sqlite_single_query

(no version information, might be only in CVS)

SQLiteDatabase->singleQuery --  Executes a query and returns either an array for one single column or the value of the first row

说明

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

Object oriented style (method):

class SQLiteDatabase {

array singleQuery ( string query [, bool first_row_only [, bool decode_binary]] )

}

警告

本函数暂无文档,仅有参数列表。


add a note add a note User Contributed Notes
franp at free dot fr
27-Sep-2004 08:42
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);
?>