diff --git a/reference/sqlite/constants.xml b/reference/sqlite/constants.xml
new file mode 100644
index 0000000000..0146b59d57
--- /dev/null
+++ b/reference/sqlite/constants.xml
@@ -0,0 +1,66 @@
+
+
+
+ Predefined constants
+
+ The functions sqlite_fetch_array and
+ sqlite_current use a constant for
+ the different types of result arrays. The following constants are
+ defined:
+
+ SQLite fetch constants
+
+
+
+ constant
+ meaning
+
+
+
+
+ SQLITE_ASSOC
+
+ Columns are returned into the array having the fieldname as the array
+ index.
+
+
+
+ SQLITE_BOTH
+
+ Columns are returned into the array having both a numerical index
+ and the fieldname as the array index.
+
+
+
+ SQLITE_NUM
+
+ Columns are returned into the array having a numerical index to the
+ fields. This index starts with 0, the first field in the result.
+
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-array-query.xml b/reference/sqlite/functions/sqlite-array-query.xml
new file mode 100644
index 0000000000..3e2ff2a8b8
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-array-query.xml
@@ -0,0 +1,70 @@
+
+
+
+
+ sqlite_array_query
+ Execute a query against a given database and returns an array
+
+
+ Description
+
+ arraysqlite_array_query
+ resourcedb
+ stringquery
+ intresult_type
+ booldecode_binary
+
+
+ sqlite_array_query is similar to calling
+ sqlite_query and then
+ sqlite_fetch_array for each row of the result set
+ and storing it into an array, as shown in the example below. Calling
+ sqlite_array_query is significantly faster than
+ using such a script.
+
+
+ sqlite_array_query implemented
+ yourself
+ ]]>
+
+
+
+
+ sqlite_array_query is best suited to queries
+ returning 45 rows or less. If you have more data than that, it is
+ recommended that you write your scripts to use
+ sqlite_unbuffered_query instead for more optimal
+ performance.
+
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-busy-timeout.xml b/reference/sqlite/functions/sqlite-busy-timeout.xml
new file mode 100644
index 0000000000..db321b7a06
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-busy-timeout.xml
@@ -0,0 +1,51 @@
+
+
+
+ sqlite_busy_timeout
+ Set busy timeout duration, or disable busy handlers
+
+
+ Description
+
+ voidsqlite_busy_timeout
+ resourcedatabase
+ intmilliseconds
+
+
+ Set the maximum time that sqlite will wait for a
+ database
+ to become ready for use to milliseconds.
+ If milliseconds is 0, busy
+ handlers will be disabled and sqlite will return immediately with a
+ SQLITE_BUSY status code if another process/thread has
+ the database locked for an update.
+
+
+ PHP sets the default busy timeout to be 60 seconds when the database is
+ opened.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-changes.xml b/reference/sqlite/functions/sqlite-changes.xml
new file mode 100644
index 0000000000..e974e2f01c
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-changes.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ sqlite_changes
+ Returns the number of rows that were changed by the most recent SQL statement
+
+
+ Description
+
+ intsqlite_changes
+ resourcedb
+
+
+ Returns the numbers of rows that were changed by the most recent SQL
+ statement executed against the database db.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-close.xml b/reference/sqlite/functions/sqlite-close.xml
new file mode 100644
index 0000000000..3c410f63fc
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-close.xml
@@ -0,0 +1,45 @@
+
+
+
+
+ sqlite_close
+ Closes an open SQLite database.
+
+
+ Description
+
+ voidsqlite_close
+ resourcedatabase
+
+
+ Closes the given database handle.
+ If the database was persistent, it will be closed and removed from the
+ persistent list.
+
+
+ See also sqlite_open and
+ sqlite_popen.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-column.xml b/reference/sqlite/functions/sqlite-column.xml
new file mode 100644
index 0000000000..41d54c0be3
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-column.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ sqlite_column
+ Fetches a column from the current row of a result set
+
+
+ Description
+
+ mixedsqlite_column
+ resourceresult
+ mixedindex_or_name
+ booldecode_binary
+
+
+ Fetches the value of a column named index_or_name
+ (if it is a string), or of the ordinal column numbered
+ index_or_name (if it is an integer) from the
+ current row of the query result handle result.
+ The decode binary flag operates in the same way as described under
+ sqlite_fetch_array.
+
+
+ Use this function when you are iterating a large result set with many
+ columns, or with columns that contain large amounts of data.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-create-function.xml b/reference/sqlite/functions/sqlite-create-function.xml
new file mode 100644
index 0000000000..6d6d05b931
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-create-function.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+ sqlite_create_function
+ Registers a "regular" User Defined Function for use in SQL statements
+
+
+ Description
+
+ boolsqlite_create_function
+ resourcedb
+ stringfunction_name
+ mixedcallback
+ intnum_args
+
+
+ sqlite_create_function allows you to register a PHP
+ function with SQLite as an UDF (User Defined
+ Function), so that it can be called from within your SQL
+ statements.
+
+
+ db specifies the database handle that you wish to
+ extend, function_name specifies the name of the
+ function that you will use in your SQL statements,
+ callback is any valid PHP callback to specify a
+ PHP function that should be called to handle the SQL function.
+ The optional parameter num_args is used as a hint
+ by the SQLite expression parser/evaluator. It is recommended that you
+ specifiy a value if your function will only ever accept a fixed number of
+ parameters.
+
+
+ The UDF can be used in any SQL statement that can call functions, such as
+ SELECT and UPDATE statements and also in triggers.
+
+
+
+ sqlite_create_function example
+
+]]>
+
+
+ In this example, we have a function that calculates the md5 sum of a
+ string, and then reverses it. When the SQL statement executes, it
+ returns the value of the filename transformed by our function. The data
+ returned in $rows contains the processed result.
+
+
+ The beauty of this technique is that you do not need to process the
+ result using a foreach() loop after you have queried for the data.
+
+
+
+
+ PHP registers a special function named php when the
+ database is first opened. The php function can be used to call any PHP
+ function without having to register it first.
+
+
+
+ Example of using the PHP function
+
+ ]]>
+
+
+ This example will call the md5 on each
+ filename column in the database and return the result
+ into $rows
+
+
+
+
+ For performance reasons, PHP will not automatically encode/decode binary
+ data passed to and from your UDF's. You need to manually encode/decode
+ the parameters and return values if you need to process binary data in
+ this way.
+
+
+ It is not recommended to use UDF's to handle processesing of
+ binary data, unless high performance is not a key requirement of your
+ application.
+
+
+
+
+ See also sqlite_register_aggregate.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-current.xml b/reference/sqlite/functions/sqlite-current.xml
new file mode 100644
index 0000000000..92070bc45e
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-current.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+ sqlite_current
+ Fetches the current row from a result set as an array
+
+
+ Description
+
+ arraysqlite_current
+ resourceresult
+ intresult_type
+ booldecode_binary
+
+
+ sqlite_current is identical to
+ sqlite_fetch_array except that it does not advance
+ to the next row prior to returning the data; it returns the data from the
+ current position only.
+
+
+ If the current position is beyond the final row, this function returns
+ &false;
+
+
+
+ This function will not work on unbuffered result handles.
+
+
+
+ See also sqlite_seek,
+ sqlite_next.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-error-string.xml b/reference/sqlite/functions/sqlite-error-string.xml
new file mode 100644
index 0000000000..5e10ec78a6
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-error-string.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+ sqlite_error_string
+ Returns the textual description of an error code
+
+
+ Description
+
+ stringsqlite_error_string
+ interror_code
+
+
+ Returns a human readable description of the
+ error_code returned from
+ sqlite_last_error.
+
+
+ See also sqlite_last_error.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-escape-string.xml b/reference/sqlite/functions/sqlite-escape-string.xml
new file mode 100644
index 0000000000..ab47f37890
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-escape-string.xml
@@ -0,0 +1,64 @@
+
+
+
+
+ sqlite_escape_string
+ Escapes a string for use as a query parameter
+
+
+ Description
+
+ stringsqlite_escape_string
+ stringitem
+
+
+ sqlite_escape_string will correctly quote the string
+ specified by item
+ for use in an SQLite SQL statement. This includes doubling up
+ single-quote characters (') and checking for
+ binary-unsafe characters in the query string.
+
+
+ If the item contains a NUL
+ character, or if it begins with a character whose ordinal value is
+ 0x01, PHP will apply a binary encoding scheme so that
+ you can safely store and retrieve binary data.
+
+
+ Although the encoding makes it safe to insert the data, it will render
+ simple text comparisions and LIKE clauses in your queries unusable for
+ the columns that contain the binary data. In practice, this shouldn't be
+ a problem, as your schema should be such that you don't use such things
+ on binary columns (in fact, it might be better to store binary data using
+ other means, such as in files).
+
+
+
+ addslashes should NOT be used
+ to quote your strings for SQLite queries; it will lead to strange results when
+ retrieving your data.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-fetch-array.xml b/reference/sqlite/functions/sqlite-fetch-array.xml
new file mode 100644
index 0000000000..ea8c05a580
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-fetch-array.xml
@@ -0,0 +1,69 @@
+
+
+
+ sqlite_fetch_array
+ Fetches the next row from a result set as an array.
+
+
+ Description
+
+ arraysqlite_fetch_array
+ resourceresult
+ intresult_type
+ booldecode_binary
+
+
+ Fetches the next row from the given result handle.
+ If there are no more rows, returns &false;, otherwise returns an
+ associative array representing the row data.
+
+
+ result_type can be used to specifiy how you want
+ the results to be returned. The default value is
+ SQLITE_BOTH which returns columns indexed by their
+ ordinal column number and by column name.
+ SQLITE_ASSOC causes the array to be indexed only by
+ column names, and SQLITE_NUM to be indexed only by
+ ordinal column numbers.
+
+
+ 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.
+
+
+ When decode_binary is set to &true; (the default),
+ PHP will decode the binary encoding it applied to the data if it
+ was encoded using the sqlite_escape_string. You
+ will usually always leave this value at its default, unless you are
+ interoperating with databases created by other sqlite capable
+ applications.
+
+
+ See also sqlite_array_query and
+ sqlite_fetch_string.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-fetch-string.xml b/reference/sqlite/functions/sqlite-fetch-string.xml
new file mode 100644
index 0000000000..853c4c185b
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-fetch-string.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+ sqlite_fetch_string
+ Fetches first column of a result set as a string.
+
+
+ Description
+
+ stringsqlite_fetch_string
+ resourceresult
+ intresult_type
+ booldecode_binary
+
+
+ sqlite_fetch_string is identical to
+ sqlite_fetch_array except that it returns the value
+ of the first column of the rowset.
+
+
+ This is the most optimial way to retrieve data when you are only
+ interested in the values from a single column of data.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-field-name.xml b/reference/sqlite/functions/sqlite-field-name.xml
new file mode 100644
index 0000000000..73144ac312
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-field-name.xml
@@ -0,0 +1,45 @@
+
+
+
+
+ sqlite_field_name
+ Returns the name of a particular field
+
+
+ Description
+
+ stringsqlite_field_name
+ resourceresult
+ intfield_index
+
+
+
+ Given the ordinal column number, field_index, returns
+ the name of that field in the result handle
+ result.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-has-more.xml b/reference/sqlite/functions/sqlite-has-more.xml
new file mode 100644
index 0000000000..0db4161419
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-has-more.xml
@@ -0,0 +1,42 @@
+
+
+
+
+ sqlite_has_more
+ Returns whether or not more rows are available
+
+
+ Description
+
+ boolsqlite_has_more
+ resourceresult
+
+
+
+ sqlite_has_more returns &true; if there are more
+ rows available from the result handle, or &false;
+ otherwise.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-last-error.xml b/reference/sqlite/functions/sqlite-last-error.xml
new file mode 100644
index 0000000000..de35569d4c
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-last-error.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ sqlite_last_error
+ Returns the error code of the last error for a database
+
+
+ Description
+
+ intsqlite_last_error
+ resourcedb
+
+
+ Returns the error code from the last operation performed on
+ db, the database handle.
+
+
+ See also sqlite_error_string.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-last-insert-rowid.xml b/reference/sqlite/functions/sqlite-last-insert-rowid.xml
new file mode 100644
index 0000000000..374e742758
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-last-insert-rowid.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ sqlite_last_insert_rowid
+ Returns the rowid of the most recently inserted row
+
+
+ Description
+
+ intsqlite_last_insert_rowid
+ resourcedb
+
+
+ Returns the rowid of the row that was most recently inserted into the
+ database db, if it was created as an
+ auto-increment field.
+
+
+
+ You can create auto-increment fields in SQLite by declaring them as
+ INTEGER PRIMARY KEY in your table schema.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-libencoding.xml b/reference/sqlite/functions/sqlite-libencoding.xml
new file mode 100644
index 0000000000..6eb35cd9c3
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-libencoding.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+ sqlite_libencoding
+ Returns the encoding of the linked SQLite library
+
+
+ Description
+
+ stringsqlite_libencoding
+
+
+ The SQLite library may be compiled in either ISO-8859-1 or UTF-8
+ compatible modes. This function allows you to determine which encoding
+ scheme is used by your version of the library.
+
+
+
+ The default PHP distribution builds libsqlite in ISO-8859-1 encoding
+ mode. However, this is a misnomer; rather than handling ISO-8859-1, it
+ operates according to your current locale settings for string
+ comparisons and sort ordering. So, rather than ISO-8859-1, you should
+ think of it as being '8-bit' instead.
+
+
+ When compiled with UTF-8 support, sqlite handles encoding and decoding
+ of UTF-8 multi-byte character sequences, but does not yet do a complete
+ job when working with the data (no normalization is performed for
+ example), and some comparison operations may still not be carried out
+ correctly.
+
+
+ It is not recommended that you use PHP in a web-server configuration
+ with a version of the SQLite library compiled with UTF-8 support, since
+ libsqlite will abort() the process if it detects a problem with the
+ UTF-8 encoding.
+
+
+
+ See also sqlite_libversion.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-libversion.xml b/reference/sqlite/functions/sqlite-libversion.xml
new file mode 100644
index 0000000000..ed4fdc9509
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-libversion.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ sqlite_libversion
+ Returns the version of the linked SQLite library
+
+
+ Description
+
+ stringsqlite_libencoding
+
+
+ Returns the version of the linked SQLite library as a string.
+
+
+ See also sqlite_libencoding.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-next.xml b/reference/sqlite/functions/sqlite-next.xml
new file mode 100644
index 0000000000..91e8a704bc
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-next.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+ sqlite_next
+ Seek to next row number
+
+
+ Description
+
+ boolsqlite_next
+ resourceresult
+
+
+ sqlite_next advances the result handle
+ result to the next row.
+ Returns &false; if there are no more rows, &true; otherwise.
+
+
+
+ This function cannot be used with unbuffered result handles.
+
+
+
+ See also sqlite_seek,
+ sqlite_current and
+ sqlite_rewind.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-num-fields.xml b/reference/sqlite/functions/sqlite-num-fields.xml
new file mode 100644
index 0000000000..0c9de7af42
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-num-fields.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ sqlite_num_fields
+ Returns the number of fields in a result set
+
+
+ Description
+
+ intsqlite_num_fields
+ resourceresult
+
+
+ Returns the number of fields in the result set.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-num-rows.xml b/reference/sqlite/functions/sqlite-num-rows.xml
new file mode 100644
index 0000000000..b2c7e9eb06
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-num-rows.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ sqlite_num_rows
+ Returns the number of rows in a result set
+
+
+ Description
+
+ intsqlite_num_rows
+ resourceresult
+
+
+ Returns the number of rows in the result set.
+
+
+
+ This function cannot be used with unbuffered result sets.
+
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-open.xml b/reference/sqlite/functions/sqlite-open.xml
new file mode 100644
index 0000000000..176c5c3721
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-open.xml
@@ -0,0 +1,110 @@
+
+
+
+
+ sqlite_open
+ Opens a SQLite database. Will create the database if it does not exist
+
+
+ Description
+
+ resourcesqlite_open
+ stringfilename
+ intmode
+ string&errmessage
+
+
+ Returns a resource on success, &false; on error.
+
+
+ The filename parameter is the name of the
+ database. It can be a relative or absolute path to the file that sqlite
+ will use to store your data. If the file does not exist, sqlite will
+ attempt to create it. You MUST have write
+ permissions to the file if you want to insert data or modify the database
+ schema.
+
+
+ The mode parameter specifies the mode of the file and is
+ intended to be used to open the database in read-only mode.
+ Presently, this parameter is ignored by the sqlite library. The default
+ value for mode is the octal value 0666 and this is the
+ recommended value to use if you need access to the
+ errmessage parameter.
+
+
+ errmessage is passed by reference and is set to
+ hold a descriptive error message explaining why the database could not be
+ opened if there was an error.
+
+
+ sqlite_open example
+
+]]>
+
+
+
+
+ On Unix platforms, SQLite is sensitive to scripts that use the fork() system call. If you
+ do have such a script, it is recommended that you close the handle prior
+ to forking and then re-open it in the child and/or parent.
+ For more information on this issue, see The C language interface
+ to the SQLite library in the section entitled
+ Multi-Threading And SQLite.
+
+
+
+
+ Starting with SQLite library version 2.8.2, you can specify
+ :memory: as the filename to
+ create a database that lives only in the memory of the computer.
+ This is useful mostly for temporary processing, as the in-memory
+ database will be destroyed when the process ends. It can also be
+ useful when coupled with the ATTACH DATABASE SQL
+ statement to load other databases and move and query data betweem them.
+
+
+
+
+ SQLite is safe_mode and open_basedir aware.
+
+
+
+
+ See also sqlite_popen,
+ sqlite_close and
+ sqlite_query.
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-popen.xml b/reference/sqlite/functions/sqlite-popen.xml
new file mode 100644
index 0000000000..dbcabc30a7
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-popen.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ sqlite_popen
+ Opens a persistent handle to an SQLite database. Will create the database if it does not exist
+
+
+ Description
+
+ resourcesqlite_popen
+ stringfilename
+ intmode
+ string&errmessage
+
+
+
+ This function behaves identically to sqlite_open
+ except that is uses the persistent resource mechanism of PHP.
+ For information about the meaning of the parameters, read the
+ sqlite_open manual page.
+
+
+
+ sqlite_popen will first check to see if a persistent
+ handle has already been opened for the given
+ filename. If it finds one, it returns that handle
+ to your script, otherwise it opens a fresh handle to the database.
+
+
+ The benefit of this approach is that you don't incurr the performance
+ cost of re-reading the database and index schema on each page hit served
+ by persistent web server SAPI's (any SAPI except for regular CGI or CLI).
+
+
+
+ If you use persistent handles and have the database updated by a
+ background process (perhaps via a crontab), and that process re-creates
+ the database by overwriting it (either by unlinking and rebuilding, or
+ moving the updated version to replace the current version),
+ you may experience undefined behaviour when a persistent handle on the
+ old version of the database is recycled.
+
+
+ To avoid this situation, have your background processes open the same
+ database file and perform their updates in a transaction.
+
+
+
+ See also sqlite_popen,
+ sqlite_close and
+ sqlite_query.
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-query.xml b/reference/sqlite/functions/sqlite-query.xml
new file mode 100644
index 0000000000..6c97799b30
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-query.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+ sqlite_query
+ Executes a query against a given database and returns a result handle
+
+
+ Description
+
+ resourcesqlite_query
+ resourcedb
+ stringquery
+
+
+ resourcesqlite_query
+ stringquery
+ resourcedb
+
+
+ Executes an SQL statement given by the query against
+ a given database (specified by the db parameter).
+
+
+ For queries that return rows, this function will return a result handle
+ which can then be used with functions such as
+ sqlite_fetch_array and
+ sqlite_seek.
+
+
+ For other kinds of queries, this function will return a boolean result;
+ &true; for success or &false; for failure.
+
+
+ Regardless of the query type, this function will return &false; if the
+ query failed.
+
+
+ sqlite_query returns a buffered, seekable result
+ handle. This is useful for reasonably small queries where you need to
+ be able to randomly access the rows. Buffered result handles will
+ allocate memory to hold the entire result and will not return until it
+ has been fetched. If you only need sequential access to the data, it is
+ recommended that you use the much higher performance
+ sqlite_unbuffered_query instead.
+
+
+
+ Two alternative syntaxes are supported for compatibility with other
+ database extensions (such as MySQL).
+ The preferred form is the first one, where the
+ db parameter is the first parameter to the
+ function.
+
+
+
+
+ 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.
+
+
+ When executing multiple queries, the return value of this function
+ will be &false; if the was an error, but undefined otherwise (it might
+ be &true; for success or it might return a result handle).
+
+
+
+ See also sqlite_array_query.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-register-aggregate.xml b/reference/sqlite/functions/sqlite-register-aggregate.xml
new file mode 100644
index 0000000000..70f13285ed
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-register-aggregate.xml
@@ -0,0 +1,130 @@
+
+
+
+
+ sqlite_register_aggregate
+ Register an aggregating UDF for use in SQL statements
+
+ Description
+
+ boolsqlite_register_aggregate
+ resourcedb
+ stringfunction_name
+ mixedstep_func
+ mixedfinalize_func
+ intnum_args
+
+
+ sqlite_register_aggregate is similar to
+ sqlite_create_function except that it registers
+ functions that can be used to calculate a result aggregated across all the
+ rows of a query.
+
+
+ The key difference between this function and
+ sqlite_create_function is that two functions are
+ required to manage the aggregate; step_func is
+ called for each row of the result set. Your PHP function should
+ accumulate the result and store it into the aggregation context.
+ Once all the rows have been processed,
+ finalize_func will be called and it should then
+ take the data from the aggregation context and return the result.
+
+
+ max_length aggregation function example
+
+ $context) {
+ $context = strlen($string);
+ }
+ }
+
+ function max_len_finalize(&$context)
+ {
+ return $context;
+ }
+
+ sqlite_create_aggregate($db, 'max_len', 'max_len_step', 'max_len_finalize');
+
+ var_dump(sqlite_array_query($db, 'SELECT max_len(a) from strings'));
+
+?>]]>
+
+
+ In this example, we are creating an aggregating function that will
+ calculate the length of the longest string in one of the columns of the
+ table. For each row, the max_len_step function is
+ called and passed a context parameter. The context
+ parameter is just like any other PHP variable and be set to hold an array
+ or even an object value. In this example, we are simply using it to hold
+ the maximum length we have seen so far; if the
+ string has a length longer than the current
+ maximum, we update the the context to hold this new maximum length.
+
+
+ After all of the rows have been processed, SQLite calls the
+ max_len_finalize function to determine the aggregate
+ result. Here, we could perform some kind of calculation based on the
+ data found in the context. In our simple example
+ though, we have been calculating the result as the query progressed, so we
+ simply need to return the context value.
+
+
+
+
+ It is NOT recommended for you to store a copy of the values in the context
+ and then process them at the end, as you would cause SQLite to use a lot of
+ memory to process the query - just think of how much memory you would need
+ if a million rows were stored in memory, each containing a string 32 bytes
+ in length.
+
+
+
+ See also sqlite_create_function.
+
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-rewind.xml b/reference/sqlite/functions/sqlite-rewind.xml
new file mode 100644
index 0000000000..7b6f0d367e
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-rewind.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ sqlite_rewind
+ Seek to the first row number
+
+
+ Description
+
+ boolsqlite_rewind
+ resourceresult
+
+
+ sqlite_rewind seeks back to the first row in the
+ result set. Returns &false; if there are no rows in the result set,
+ &true; otherwise.
+
+
+
+ This function cannot be used with unbuffered result sets.
+
+
+
+ See also sqlite_next,
+ sqlite_current and sqlite_seek.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-seek.xml b/reference/sqlite/functions/sqlite-seek.xml
new file mode 100644
index 0000000000..32478c4129
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-seek.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+ sqlite_seek
+ Seek to a particular row number
+
+
+ Description
+
+ boolsqlite_rewind
+ resourceresult
+ intrownum
+
+
+ sqlite_seek seeks to the row given by the parameter
+ rownum. The row number is one-based (1 is the
+ first row). Returns &false; if the row does not exist, &true; otherwise.
+
+
+
+ This function cannot be used with unbuffered result handles.
+
+
+
+ See also sqlite_next,
+ sqlite_current and
+ sqlite_rewind.
+
+
+
+
+
+
diff --git a/reference/sqlite/functions/sqlite-unbuffered-query.xml b/reference/sqlite/functions/sqlite-unbuffered-query.xml
new file mode 100644
index 0000000000..4f02f3dc3a
--- /dev/null
+++ b/reference/sqlite/functions/sqlite-unbuffered-query.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+ sqlite_unbuffered_query
+ Execute a query that does not prefetch and buffer all data
+
+
+ Description
+
+ resourcesqlite_unbuffered_query
+ resourcedb
+ stringquery
+
+
+ resourcesqlite_unbuffered_query
+ stringquery
+ resourcedb
+
+
+ sqlite_unbuffered_query is identical to
+ sqlite_query except that the result that is returned
+ is a sequential forward-only result set that can only be used to read
+ each row, one after the other.
+
+
+ This function is ideal for generating things such as HTML tables where
+ you only need to process one row at a time and don't need to randomly
+ access the row data.
+
+
+
+ Functions such as sqlite_seek and
+ sqlite_rewind do not work on result handles
+ returned from this function.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/ini.xml b/reference/sqlite/ini.xml
new file mode 100644
index 0000000000..af5a3b8dbe
--- /dev/null
+++ b/reference/sqlite/ini.xml
@@ -0,0 +1,86 @@
+
+
+
+ &reftitle.runtime;
+ &extension.runtime;
+
+
+ For further details and definition of the PHP_INI_* constants see
+ ini_set.
+
+
+ Here is a short explanation of the configuration directives.
+
+
+
+ sqlite.assoc_case
+ int
+
+
+
+ Whether to use mixed case (0), upper case
+ (1) or lower case (2) hash
+ indexes.
+
+
+ This option is primarily useful when you need compatibility with other
+ database systems, where the names of the columns are always returned as
+ uppercase or lowercase, regardless of the case of the actual field names
+ in the database schema.
+
+
+ The SQLite library returns the column names in their natural case (that
+ matches the case you used in your schema). When
+ sqlite.assoc_case is set to 0
+ the natural case will be preserved. When it is set to
+ 1 or 2, PHP will apply case
+ folding on the hash keys to upper- or lower-case the keys, respectively.
+
+
+ Use of this option incurrs a slight performance penalty, but is MUCH
+ faster than performing the case folding yourself using PHP script.
+
+
+
+
+
+
+
+
diff --git a/reference/sqlite/reference.xml b/reference/sqlite/reference.xml
new file mode 100644
index 0000000000..7148d410f8
--- /dev/null
+++ b/reference/sqlite/reference.xml
@@ -0,0 +1,97 @@
+
+
+
+ SQLite
+ SQLite
+
+ &warn.experimental;
+
+ &reftitle.intro;
+
+ About SQLite
+
+ This is an extension for the SQLite Embeddable SQL Database Engine.
+ SQLite is a C library that implements an embeddable SQL database engine.
+ Programs that link with the SQLite library can have SQL database access
+ without running a separate RDBMS process.
+
+
+ SQLite is not a client library used to connect to a big database server.
+ SQLite is the server. The SQLite library reads and writes directly to and from
+ the database files on disk.
+
+
+
+ For further information see the SQLite Website
+ (http://www.sqlite.org).
+
+
+
+
+ Installation
+
+ Read the INSTALL file, which comes with the package. Or just use the PEAR
+ installer with "pear install sqlite".
+ SQLite itself is already included, You do not need to install
+ any additional software.
+
+
+ You can download the Windows version of the extension from http://snaps.php.net/win32/PECL_STABLE/php_sqlite.dll
+
+
+
+ Contact Information
+
+ Any questions about the extension should be asked on one of the
+ PHP Mailing lists.
+
+
+
+
+ &reftitle.required;
+
+ In order to have these functions available, you must compile PHP with
+ SQLite support, or load the SQLite extension dynamically from your
+ php.ini.
+
+
+
+
+ &reftitle.resources;
+
+ There are two resources used in the SQLite Interface. The first one is the
+ database connection, the second one the result set.
+
+
+
+ &reference.sqlite.constants;
+ &reference.sqlite.ini;
+
+
+
+&reference.sqlite.functions;
+
+
+
+