PHP: sqlite_exec - Manual in Deutsh
PHP: sqlite_exec - Manual in French
PHP: sqlite_exec - Manual in Polish

You Are At PHP: sqlite_exec - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

sqlite_exec

(PHP 5)

sqlite_exec

(no version information, might be only in CVS)

SQLiteDatabase->exec -- Executes a result-less query against a given database

Description

bool sqlite_exec ( resource dbhandle, string query [, string &error_msg] )

bool sqlite_exec ( string query, resource dbhandle )

Object oriented style (method):

class SQLiteDatabase {

bool queryExec ( string query [, string &error_msg] )

}

Executes an SQL statement given by the query against a given database handle (specified by the dbhandle parameter).

Warning

SQLite will execute multiple queries separated by semicolons, so you can use it to execute a batch of SQL that you have loaded from a file or have embedded in a script.

Parameters

dbhandle

The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.

query

The query to be executed.

error_msg

The specified variable will be filled if an error occurs. This is specially important because SQL syntax errors can't be fetched using the sqlite_last_error() function.

Note: Two alternative syntaxes are supported for compatibility with other database extensions (such as MySQL). The preferred form is the first, where the dbhandle parameter is the first parameter to the function.

Return Values

This function will return a boolean result; TRUE for success or FALSE for failure. If you need to run a query that returns rows, see sqlite_query().

The column names returned by SQLITE_ASSOC and SQLITE_BOTH will be case-folded according to the value of the sqlite.assoc_case configuration option.

ChangeLog

VersionDescription
5.1.0 Added the error_msg parameter

Examples

Example 1. Procedural example

<?php
$dbhandle
= sqlite_open('mysqlitedb');
$query = sqlite_exec($dbhandle, "UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'", $error);
if (!
$query) {
    exit(
"Error in query: '$error'");
} else {
    echo
'Number of rows modified: ', sqlite_changes($dbhandle);
}
?>

Example 2. Object-oriented example

<?php
$dbhandle
= new SQLiteDatabase('mysqlitedb');
$query = $dbhandle->queryExec("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'", $error);
if (!
$query) {
    exit(
"Error in query: '$error'");
} else {
    echo
'Number of rows modified: ', $dbhandle->changes();
}
?>

See Also

sqlite_query()
sqlite_unbuffered_query()
sqlite_array_query()

końcówki kolekcji, usuwanie zmarszczek, wizy do rosji, wizy do rosji gdańsk, foteliki samochodowe, usługi geodezyjne
apteka Nowhere trip Garnitury tłumaczenia pisemne mieszkania Wrocław

Another Useful functions:


ref.sqlite | ref.pdo-sqlite | ref.pdo-sqlite.connection | function.sqlite-valid | function.sqlite-unbuffered-query | function.sqlite-udf-encode-binary | function.sqlite-udf-decode-binary | function.sqlite-single-query | function.sqlite-seek | function.sqlite-rewind | function.sqlite-query | function.sqlite-prev | function.sqlite-popen | function.sqlite-open | function.sqlite-num-rows | function.sqlite-num-fields | function.sqlite-next | function.sqlite-libversion | function.sqlite-libencoding | function.sqlite-last-insert-rowid | function.sqlite-last-error | function.sqlite-key | function.sqlite-has-prev | function.sqlite-has-more | function.sqlite-field-name | function.sqlite-fetch-string | function.sqlite-fetch-single | function.sqlite-fetch-object | function.sqlite-fetch-column-types | function.sqlite-fetch-array | function.sqlite-fetch-all | function.sqlite-factory | function.sqlite-exec | function.sqlite-escape-string | function.sqlite-error-string | function.sqlite-current | function.sqlite-create-function | function.sqlite-create-aggregate | function.sqlite-column | function.sqlite-close | function.sqlite-changes | function.sqlite-busy-timeout | function.sqlite-array-query | function.pdo-sqlitecreatefunction | function.pdo-sqlitecreateaggregate |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.