PHP Doku:: Führt eine Query aus und liefert ein Array für eine einzige Spalte oder den Wert der ersten Reihe. - function.sqlite-single-query.html

Verlauf / Chronik / History: (36) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenSQLiteSQLite Funktionensqlite_single_query -- SQLiteDatabase->singleQuery

Ein Service von Reinhard Neidl - Webprogrammierung.

SQLite Funktionen

<<sqlite_seek -- SQLiteResult->seek

sqlite_udf_decode_binary>>

sqlite_single_query

SQLiteDatabase->singleQuery

(PHP 5, PECL sqlite >= 1.0.1)

sqlite_single_query -- SQLiteDatabase->singleQuery Führt eine Query aus und liefert ein Array für eine einzige Spalte oder den Wert der ersten Reihe.

Beschreibung

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

Objektorientierter Stil (Methode):

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

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.


2 BenutzerBeiträge:
- Beiträge aktualisieren...
oohall AT gmail DOT comMERCIAL
11.04.2008 7:38
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.
franp at free dot fr
27.09.2004 2: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);
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)