From ab8f44f73b834842abd61e219af876b8e98ce002 Mon Sep 17 00:00:00 2001 From: Kenneth Schwartz Date: Mon, 21 Feb 2005 00:31:07 +0000 Subject: [PATCH] switch to new structure git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@180267 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../sqlite/functions/sqlite-array-query.xml | 157 ++++++++++++------ .../sqlite/functions/sqlite-busy-timeout.xml | 86 +++++++--- reference/sqlite/functions/sqlite-changes.xml | 52 +++++- reference/sqlite/functions/sqlite-close.xml | 39 ++++- reference/sqlite/functions/sqlite-column.xml | 70 ++++++-- .../functions/sqlite-create-aggregate.xml | 75 ++++++++- .../functions/sqlite-create-function.xml | 86 +++++++--- reference/sqlite/functions/sqlite-current.xml | 61 +++++-- .../sqlite/functions/sqlite-error-string.xml | 16 +- .../sqlite/functions/sqlite-escape-string.xml | 15 +- reference/sqlite/functions/sqlite-exec.xml | 80 +++++++-- reference/sqlite/functions/sqlite-factory.xml | 67 +++++++- .../sqlite/functions/sqlite-fetch-all.xml | 73 +++++++- .../sqlite/functions/sqlite-fetch-array.xml | 102 +++++++++++- .../functions/sqlite-fetch-column-types.xml | 81 +++++++-- .../sqlite/functions/sqlite-fetch-object.xml | 7 +- .../sqlite/functions/sqlite-fetch-single.xml | 44 ++++- .../sqlite/functions/sqlite-fetch-string.xml | 8 +- .../sqlite/functions/sqlite-field-name.xml | 43 ++++- .../sqlite/functions/sqlite-has-more.xml | 48 +++++- .../sqlite/functions/sqlite-has-prev.xml | 52 ++++-- reference/sqlite/functions/sqlite-key.xml | 82 +++++++-- .../sqlite/functions/sqlite-last-error.xml | 34 +++- .../functions/sqlite-last-insert-rowid.xml | 27 ++- .../sqlite/functions/sqlite-libencoding.xml | 16 +- .../sqlite/functions/sqlite-libversion.xml | 16 +- reference/sqlite/functions/sqlite-next.xml | 45 ++++- .../sqlite/functions/sqlite-num-fields.xml | 35 +++- .../sqlite/functions/sqlite-num-rows.xml | 55 +++++- reference/sqlite/functions/sqlite-open.xml | 97 +++++++---- reference/sqlite/functions/sqlite-popen.xml | 66 +++++++- reference/sqlite/functions/sqlite-prev.xml | 50 ++++-- reference/sqlite/functions/sqlite-query.xml | 57 ++++++- reference/sqlite/functions/sqlite-rewind.xml | 49 +++++- reference/sqlite/functions/sqlite-seek.xml | 59 ++++++- .../sqlite/functions/sqlite-single-query.xml | 7 +- .../functions/sqlite-udf-decode-binary.xml | 24 ++- .../functions/sqlite-udf-encode-binary.xml | 22 ++- .../functions/sqlite-unbuffered-query.xml | 56 ++++++- reference/sqlite/functions/sqlite-valid.xml | 48 +++++- reference/sqlite/ini.xml | 10 +- 41 files changed, 1721 insertions(+), 396 deletions(-) diff --git a/reference/sqlite/functions/sqlite-array-query.xml b/reference/sqlite/functions/sqlite-array-query.xml index 63c9eea335..e1f62a7b2b 100644 --- a/reference/sqlite/functions/sqlite-array-query.xml +++ b/reference/sqlite/functions/sqlite-array-query.xml @@ -1,13 +1,14 @@ - + sqlite_array_query SQLiteDatabase->arrayQuery Execute a query against a given database and returns an array - - Description + + + &reftitle.description; arraysqlite_array_query resourcedbhandle @@ -33,54 +34,11 @@ - 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.result-type; - &sqlite.case-fold; - &sqlite.decode-bin; - - - <function>sqlite_array_query</function> implemented yourself - - -]]> - - - - - - <function>sqlite_array_query</function> example - -arrayQuery('SELECT name, email FROM users LIMIT 25', SQLITE_ASSOC); -foreach ($result as $entry) { - echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email']; -} -?> -]]> - - + sqlite_array_query executes the given query and returns + an array of the entire result set. It is similar to calling + sqlite_query and then sqlite_fetch_array + for each row in the result set. sqlite_array_query is + significantly faster than the aforementioned. @@ -91,14 +49,103 @@ foreach ($result as $entry) { performance. - &sqlite.param-compat; + + + + &reftitle.parameters; - See also sqlite_query, - sqlite_fetch_array, and - sqlite_fetch_string. + + + query + + + The query to be executed. + + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + result_type + + &sqlite.result-type; + + + + decode_binary + + &sqlite.decode-bin; + + + + + &sqlite.param-compat; + + + + &reftitle.returnvalues; + + Returns an array of the entire result set; &false; otherwise. + + &sqlite.case-fold; + + + + &reftitle.examples; + + + Procedural style + + +]]> + + + + + + Object-oriented style + +arrayQuery('SELECT name, email FROM users LIMIT 25', SQLITE_ASSOC); +foreach ($result as $entry) { + echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email']; +} +?> +]]> + + + + + + + &reftitle.seealso; + + + sqlite_query + sqlite_fetch_array + sqlite_fetch_string + + + sqlite_busy_timeout SQLiteDatabase->busyTimeout Set busy timeout duration, or disable busy handlers - - Description + + + &reftitle.description; voidsqlite_busy_timeout resourcedbhandle @@ -22,29 +23,70 @@ - Set the maximum time that sqlite will wait for a - dbhandle - 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. + Set the maximum time, in milliseconds, that SQLite will wait for a + dbhandle to become ready for use. + + + + &reftitle.parameters; - PHP sets the default busy timeout to be 60 seconds when the database is - opened. + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + milliseconds + + + The number of milliseconds. When set to + 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. + + + + There are one thousand (1000) milliseconds in one second. + + + + + + + + + &reftitle.examples; - <function>sqlite_busy_timeout</function> example + Procedural style ]]> + + + + + + Object oriented style + +busyTimeout(10000); // 10 seconds $dbhandle->busyTimeout(0); // disable @@ -52,16 +94,18 @@ $dbhandle->busyTimeout(0); // disable - - - There are one thousand (1000) milliseconds in one second. - - + + + + &reftitle.seealso; - See also sqlite_open. + + sqlite_open + + + sqlite_changes @@ -9,8 +9,9 @@ recent SQL statement - - Description + + + &reftitle.description; intsqlite_changes resourcedbhandle @@ -28,9 +29,31 @@ statement executed against the dbhandle database handle. + + + + &reftitle.parameters; + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + + + + &reftitle.examples; - <function>sqlite_changes</function> example + Procedural style ]]> + + + + + + Object oriented style + +query("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'"); if (!$query) { @@ -50,13 +81,18 @@ if (!$query) { } else { echo 'Number of rows modified: ', $dbhandle->changes(); } - ?>]]> + + + + &reftitle.seealso; - See also sqlite_num_rows. + + sqlite_open + diff --git a/reference/sqlite/functions/sqlite-close.xml b/reference/sqlite/functions/sqlite-close.xml index b79dccf895..ad8c1c8873 100644 --- a/reference/sqlite/functions/sqlite-close.xml +++ b/reference/sqlite/functions/sqlite-close.xml @@ -1,12 +1,13 @@ - + sqlite_close Closes an open SQLite database - - Description + + + &reftitle.description; voidsqlite_close resourcedbhandle @@ -16,6 +17,27 @@ If the database was persistent, it will be closed and removed from the persistent list. + + + + &reftitle.parameters; + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. + + + + + + + + + &reftitle.examples; <function>sqlite_close</function> example @@ -29,12 +51,19 @@ sqlite_close($dbhandle); + + + + &reftitle.seealso; - See also sqlite_open and - sqlite_popen. + + sqlite_open + sqlite_popen + + + - - sqlite_column - SQLiteResult->column - SQLiteUnbuffered->column - Fetches a column from the current row of a result set - - - Description + + sqlite_column + SQLiteResult->column + SQLiteUnbuffered->column + Fetches a column from the current row of a result set + + + + &reftitle.description; mixedsqlite_column resourceresult @@ -37,16 +38,59 @@ index_or_name (if it is an integer) from the current row of the query result handle result. - &sqlite.decode-bin; + + + + &reftitle.parameters; - Use this function when you are iterating a large result set with many - columns, or with columns that contain large amounts of data. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + index_or_name + + + The column index or name to fetch. + + + + + decode_binary + + &sqlite.decode-bin; + + + + + + + &reftitle.notes; + + + Use this function when you are iterating a large result set with many + columns, or with columns that contain large amounts of data. + + + + + + &reftitle.seealso; - See also sqlite_fetch_string. + + sqlite_fetch_string + + + sqlite_create_aggregate SQLiteDatabase->createAggregate Register an aggregating UDF for use in SQL statements - - Description + + + &reftitle.description; boolsqlite_create_aggregate resourcedbhandle @@ -45,6 +46,61 @@ Callback functions should return a type understood by SQLite (i.e. scalar type). + + + + &reftitle.parameters; + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + function_name + + + The name of the function used in SQL statements. + + + + + step_func + + + Callback function called for each row of the result set. + + + + + finalize_func + + + Callback function to aggregate the "stepped" data from each row. + + + + + num_args + + + Hint to the SQLite parser if the callback function accepts a + predetermined number of arguments. + + + + + + + + + &reftitle.examples; max_length aggregation function example @@ -134,13 +190,20 @@ var_dump(sqlite_array_query($dbhandle, 'SELECT max_len(a) from strings')); SQL functions. + + + + &reftitle.seealso; - See also sqlite_create_function, - sqlite_udf_encode_binary and - sqlite_udf_decode_binary. + + sqlite_create_function + sqlite_udf_encode_binary + sqlite_udf_decode_binary + + + sqlite_create_function @@ -8,8 +8,9 @@ Registers a "regular" User Defined Function for use in SQL statements - - Description + + + &reftitle.description; boolsqlite_create_function resourcedbhandle @@ -30,26 +31,66 @@ 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. - - - dbhandle 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. - Callback function should return a type understood by SQLite (i.e. - scalar type). - The optional parameter num_args is used as a hint - by the SQLite expression parser/evaluator. It is recommended that you - specify a value if your function will only ever accept a fixed number of - parameters. + Function), so that it can be called from within your SQL statements. The UDF can be used in any SQL statement that can call functions, such as SELECT and UPDATE statements and also in triggers. + + + + &reftitle.parameters; + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + function_name + + + The name of the function used in SQL statements. + + + + + callback + + + Callback function to handle the defined SQL function. + + + + Callback functions should return a type understood by SQLite (i.e. + scalar type). + + + + + + num_args + + + Hint to the SQLite parser if the callback function accepts a + predetermined number of arguments. + + + + + + &sqlite.param-compat; + + + + &reftitle.examples; <function>sqlite_create_function</function> example @@ -131,11 +172,18 @@ $rows = sqlite_array_query($dbhandle, "SELECT php('md5', filename) from files"); SQL functions. + + + + &reftitle.seealso; - See also sqlite_create_aggregate. + + sqlite_create_aggregate + + + sqlite_current @@ -7,8 +7,9 @@ SQLiteUnbuffered->current Fetches the current row from a result set as an array - - Description + + + &reftitle.description; arraysqlite_current resourceresult @@ -38,20 +39,58 @@ to the next row prior to returning the data; it returns the data from the current position only. + + + + &reftitle.parameters; - If the current position is beyond the final row, this function returns - &false; + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + result_type + + &sqlite.result-type; + + + + decode_binary + + &sqlite.decode-bin; + + + - &sqlite.result-type; - &sqlite.case-fold; - &sqlite.decode-bin; + + + + &reftitle.returnvalues; - See also sqlite_seek, - sqlite_next, and - sqlite_fetch_array. + Returns an array of the current row from a result set; &false; if the + current position is beyond the final row. + + &sqlite.case-fold; + + + + &reftitle.seealso; + + + sqlite_seek + sqlite_next + sqlite_fetch_array + + + sqlite_error_string Returns the textual description of an error code - - Description + + + &reftitle.description; stringsqlite_error_string interror_code @@ -16,11 +17,18 @@ error_code returned from sqlite_last_error. + + + + &reftitle.seealso; - See also sqlite_last_error. + + sqlite_last_error + + + sqlite_escape_string Escapes a string for use as a query parameter - - Description + + + &reftitle.description; stringsqlite_escape_string stringitem @@ -47,8 +48,14 @@ sqlite_udf_encode_binary instead. + + + + &reftitle.seealso; - See also sqlite_udf_encode_binary. + + sqlite_udf_encode_binary + diff --git a/reference/sqlite/functions/sqlite-exec.xml b/reference/sqlite/functions/sqlite-exec.xml index 91a1760e7e..2b8e0069f9 100644 --- a/reference/sqlite/functions/sqlite-exec.xml +++ b/reference/sqlite/functions/sqlite-exec.xml @@ -1,13 +1,14 @@ - + sqlite_exec SQLiteDatabase->exec Executes a result-less query against a given database - - Description + + + &reftitle.description; boolsqlite_exec resourcedbhandle @@ -31,10 +32,6 @@ a given database handle (specified by the dbhandle parameter). - - 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. - SQLite will execute multiple queries separated by @@ -42,9 +39,49 @@ loaded from a file or have embedded in a script. + + + + &reftitle.parameters; + + + + query + + + The query to be executed. + + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + &sqlite.param-compat; + + + + &reftitle.returnvalues; + + 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. + + &sqlite.case-fold; + + + + &reftitle.examples; - <function>sqlite_exec</function> example + Procedural example ]]> + + + + + + Object-oriented example + +exec("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'"); if (!$query) { @@ -64,19 +109,24 @@ if (!$query) { } else { echo 'Number of rows modified: ', $dbhandle->changes(); } - ?>]]> - &sqlite.param-compat; + + + + &reftitle.seealso; - See also sqlite_query, - sqlite_unbuffered_query and - sqlite_array_query. + + sqlite_query + sqlite_unbuffered_query + sqlite_array_query + + + sqlite_factory Opens a SQLite database and returns a SQLiteDatabase object - - Description + + + &reftitle.description; SQLiteDatabasesqlite_factory stringfilename intmode stringerror_message - - Returns a SQLiteDatabase object on success, &null; on error. - sqlite_factory behaves similarly to sqlite_open in that it opens an SQLite database or @@ -24,6 +22,53 @@ returned rather than a resource. Please see the sqlite_open reference page for further usage and caveats. + + + + &reftitle.parameters; + + + + filename + + + The filename of the SQLite database. + + + + + mode + + + The mode of the file. 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. + + + + + error_message + + + 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. + + + + + + + + + &reftitle.returnvalues; + + Returns a SQLiteDatabase object on success, &null; on error. + + + + + &reftitle.examples; <function>sqlite_factory</function> example @@ -42,9 +87,15 @@ $dbhandle->query('SELECT user_id, username FROM users'); + + + + &reftitle.seealso; - See also sqlite_open and - sqlite_popen. + + sqlite_open + sqlite_popen + diff --git a/reference/sqlite/functions/sqlite-fetch-all.xml b/reference/sqlite/functions/sqlite-fetch-all.xml index 4bf6fd2f25..a8efb1b763 100755 --- a/reference/sqlite/functions/sqlite-fetch-all.xml +++ b/reference/sqlite/functions/sqlite-fetch-all.xml @@ -1,5 +1,5 @@ - + sqlite_fetch_all @@ -7,8 +7,9 @@ SQLiteUnbuffered->fetchAll Fetches all rows from a result set as an array of arrays - - Description + + + &reftitle.description; arraysqlite_fetch_all resourceresult @@ -39,12 +40,51 @@ sqlite_unbuffered_query) and then sqlite_fetch_array for each row in the result set. - &sqlite.result-type; + + + + &reftitle.parameters; + + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + result_type + + &sqlite.result-type; + + + + decode_binary + + &sqlite.decode-bin; + + + + + + + + &reftitle.returnvalues; + + Returns an array of the current row from a result set; &false; if the + current position is beyond the final row. + &sqlite.case-fold; - &sqlite.decode-bin; + + + + &reftitle.examples; - <function>sqlite_fetch_all</function> example + Procedural example +]]> + + + + + + Object-oriented example + +query('SELECT name, email FROM users LIMIT 25'); // buffered result set @@ -70,7 +119,15 @@ foreach ($result as $entry) { + + + &reftitle.seealso; + + + sqlite_fetch_array + + diff --git a/reference/sqlite/functions/sqlite-fetch-array.xml b/reference/sqlite/functions/sqlite-fetch-array.xml index 84ab95fda7..7a24c4ec12 100644 --- a/reference/sqlite/functions/sqlite-fetch-array.xml +++ b/reference/sqlite/functions/sqlite-fetch-array.xml @@ -1,5 +1,5 @@ - + sqlite_fetch_array @@ -7,8 +7,9 @@ SQLiteUnbuffered->fetch Fetches the next row from a result set as an array - - Description + + + &reftitle.description; arraysqlite_fetch_array resourceresult @@ -36,16 +37,99 @@ 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. - - &sqlite.result-type; - &sqlite.case-fold; - &sqlite.decode-bin; + + + + + &reftitle.parameters; - See also sqlite_array_query and - sqlite_fetch_string. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + result_type + + &sqlite.result-type; + + + + decode_binary + + &sqlite.decode-bin; + + + + + + + + &reftitle.returnvalues; + + Returns an array of the next row from a result set; &false; if the + next position is beyond the final row. + + &sqlite.case-fold; + + + + &reftitle.examples; + + + Procedural example + + +]]> + + + + + + Object-oriented example + +query('SELECT name, email FROM users LIMIT 25'); // buffered result set +$query = $dbhandle->unbufferedQuery('SELECT name, email FROM users LIMIT 25'); // unbuffered result set + +$result = $query->fetchAll(SQLITE_ASSOC); +foreach ($result as $entry) { + echo 'Name: ' . $entry['name'] . ' E-mail: ' . $entry['email']; +} +?> +]]> + + + + + + + &reftitle.seealso; + + + sqlite_array_query + sqlite_fetch_string + + + sqlite_fetch_column_types @@ -8,8 +8,9 @@ Return an array of column types from a particular table - - Description + + + &reftitle.description; arraysqlite_fetch_column_types stringtable_name @@ -29,19 +30,53 @@ sqlite_fetch_column_types returns an array of column data types from the specified table_name table. + + + + &reftitle.parameters; - The optional result_type parameter accepts a - constant and determines how the returned array will be indexed. Using - SQLITE_ASSOC will return only associative indices - (named fields) while SQLITE_NUM will return only - numerical indices (ordinal field numbers). SQLITE_BOTH - will return both associative and numerical indices. - SQLITE_ASSOC is the default for this function. + + + table_name + + + The table name to query. + + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + result_type + + &sqlite.result-type; + + + + + + + + &reftitle.returnvalues; + + Returns an array of column data types; &false; on error. &sqlite.case-fold; + + + + &reftitle.examples; - <function>sqlite_fetch_column_types</function> example + Procedural example $type) { echo "Column: $column Type: $type"; } -/* Output: - * Column: bar Type: VARCHAR - * Column: arf Type: TEXT -*/ - -/* OO Example */ +?> +]]> + + + + + + Object-oriented example + +query('CREATE TABLE foo (bar varchar(10), arf text)'); $cols = $db->fetchColumnTypes('foo', SQLITE_ASSOC); @@ -68,6 +108,13 @@ foreach ($cols as $column => $type) { ?> ]]> + &example.outputs; + + + diff --git a/reference/sqlite/functions/sqlite-fetch-object.xml b/reference/sqlite/functions/sqlite-fetch-object.xml index 6a57b0570a..531b3763de 100755 --- a/reference/sqlite/functions/sqlite-fetch-object.xml +++ b/reference/sqlite/functions/sqlite-fetch-object.xml @@ -1,5 +1,5 @@ - + sqlite_fetch_object @@ -7,8 +7,9 @@ SQLiteUnbuffered->fetchObject Fetches the next row from a result set as an object - - Description + + + &reftitle.description; objectsqlite_fetch_object resourceresult diff --git a/reference/sqlite/functions/sqlite-fetch-single.xml b/reference/sqlite/functions/sqlite-fetch-single.xml index 5c219ed859..6bc7fa658b 100644 --- a/reference/sqlite/functions/sqlite-fetch-single.xml +++ b/reference/sqlite/functions/sqlite-fetch-single.xml @@ -1,5 +1,5 @@ - + sqlite_fetch_single @@ -7,8 +7,9 @@ SQLiteUnbuffered->fetchSingle Fetches the first column of a result set as a string - - Description + + + &reftitle.description; stringsqlite_fetch_single resourceresult @@ -38,7 +39,33 @@ This is the most optimal way to retrieve data when you are only interested in the values from a single column of data. - &sqlite.decode-bin; + + + + &reftitle.parameters; + + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + decode_binary + + &sqlite.decode-bin; + + + + + + + + &reftitle.examples; A <function>sqlite_fetch_single</function> example @@ -61,11 +88,18 @@ if ($dbhandle = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { + + + + &reftitle.seealso; - See also sqlite_fetch_array. + + sqlite_fetch_array + + + sqlite_fetch_string Alias of sqlite_fetch_single - - Description + + + &reftitle.description; This function is an alias of sqlite_fetch_single. + + sqlite_field_name @@ -7,8 +7,9 @@ SQLiteUnbuffered->fieldName Returns the name of a particular field - - Description + + + &reftitle.description; stringsqlite_field_name resourceresult @@ -34,13 +35,41 @@ sqlite_field_name returns the name of that field in the result set result. + + + + &reftitle.parameters; - The column name returned by sqlite_field_name will be - case-folded according to the value of the - sqlite.assoc_case configuration - option. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + field_index + + + The ordinal column number in the result set. + + + + + + + &reftitle.returnvalues; + + Returns the name of a field in an SQLite result set, given the ordinal + column number; &false; on error. + + &sqlite.case-fold; + + sqlite_has_more - Returns whether or not more rows are available + Finds whether or not more rows are available - - Description + + + &reftitle.description; boolsqlite_has_more resourceresult - sqlite_has_more returns &true; if there are more - rows available from the result handle, or &false; - otherwise. + Finds whether more rows are available from the given result set. + + + + &reftitle.parameters; - See also sqlite_num_rows and - sqlite_changes. + + + result + + + The SQLite result resource. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if there are more rows available from the + result handle, or &false; otherwise. + + + + + &reftitle.seealso; + + + sqlite_num_rows + sqlite_changes + + + sqlite_has_prev SQLiteResult->hasPrev Returns whether or not a previous row is available - - Description + + + &reftitle.description; boolsqlite_has_prev resourceresult @@ -21,19 +22,48 @@ - sqlite_has_prev returns &true; if there are more - previous rows available from the result handle, or - &false; otherwise; + Find whether there are more previous rows from the given result handle. - &sqlite.no-unbuffered; + + + + &reftitle.parameters; - See also - sqlite_prev, - sqlite_has_more, and - sqlite_num_rows. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns &true; if there are more previous rows available from the + result handle, or &false; otherwise. + + + + + &reftitle.seealso; + + + sqlite_prev + sqlite_has_more + sqlite_num_rows + + + sqlite_key SQLiteResult->key Returns the current row index - - Description + + + &reftitle.description; intsqlite_key resourceresult @@ -24,22 +25,73 @@ sqlite_key returns the current row index of the buffered result set result. - &sqlite.no-unbuffered; - - - Prior to PHP 5.0.4, sqlite_key was only able to be - called as a method on a - SQLiteResult object and - not procedurally. - - + + + + &reftitle.parameters; - See also sqlite_next, - sqlite_current and - sqlite_rewind. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns the current row index of the buffered result set + result. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.0.4 + + Prior to PHP 5.0.4, sqlite_key was only able to be + called as a method on a + SQLiteResult object, + not procedurally. + + + + + + + + + + &reftitle.seealso; + + + sqlite_next + sqlite_current + sqlite_rewind + + + sqlite_last_error SQLiteDatabase->lastError Returns the error code of the last error for a database - - Description + + + &reftitle.description; intsqlite_last_error resourcedbhandle @@ -26,11 +27,36 @@ description of the error code can be retrieved using sqlite_error_string. + + + + &reftitle.parameters; - See also sqlite_error_string. + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + + + + &reftitle.seealso; + + + sqlite_error_string + + + sqlite_last_insert_rowid SQLiteDatabase->lastInsertRowid Returns the rowid of the most recently inserted row - - Description + + + &reftitle.description; intsqlite_last_insert_rowid resourcedbhandle @@ -32,7 +33,27 @@ + + + &reftitle.parameters; + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + + + + sqlite_libencoding Returns the encoding of the linked SQLite library - - Description + + + &reftitle.description; stringsqlite_libencoding @@ -40,11 +41,18 @@ UTF-8 encoding. + + + + &reftitle.seealso; - See also sqlite_libversion. + + sqlite_lib_version + + + sqlite_libversion Returns the version of the linked SQLite library - + + Description stringsqlite_libversion - Returns the version of the linked SQLite library as a string. + Returns the version of the linked SQLite library. + + + + &reftitle.seealso; - See also sqlite_libencoding. + + sqlite_libencoding + + + sqlite_next @@ -7,8 +7,9 @@ SQLiteUnbuffered->next Seek to the next row number - - Description + + + &reftitle.description; boolsqlite_next resourceresult @@ -31,15 +32,45 @@ sqlite_next advances the result handle result to the next row. - Returns &false; if there are no more rows, &true; otherwise. + + + + &reftitle.parameters; - See also sqlite_seek, - sqlite_current and - sqlite_rewind. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; on success, or &false; if there are no more rows. + + + + + &reftitle.seealso; + + + sqlite_seek + sqlite_current + sqlite_rewind + + + sqlite_num_fields @@ -7,8 +7,9 @@ SQLiteUnbuffered->numFields Returns the number of fields in a result set - - Description + + + &reftitle.description; intsqlite_num_fields resourceresult @@ -31,12 +32,36 @@ Returns the number of fields in the result set. + + + + &reftitle.parameters; - See also sqlite_column and - sqlite_num_rows. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + + + + + + + + &reftitle.seealso; + + + sqlite_changes + sqlite_num_rows + + + sqlite_num_rows SQLiteResult->numRows Returns the number of rows in a buffered result set - + + Description intsqlite_num_rows @@ -24,10 +25,31 @@ Returns the number of rows in the buffered result set. - &sqlite.no-unbuffered; + + + + &reftitle.parameters; + + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.examples; - <function>sqlite_num_rows</function> example + Procedural example +]]> + + + + + + Object-oriented example + +query("SELECT * FROM mytable WHERE name='John Doe'"); $rows = $result->numRows(); @@ -48,12 +79,20 @@ echo "Number of rows: $rows"; + + + + &reftitle.seealso; - See also sqlite_changes and - sqlite_query. + + sqlite_changes + sqlite_query + sqlite_num_fields + + + sqlite_open Opens a SQLite database and create the database if it does not exist - - Description + + + &reftitle.description; resourcesqlite_open stringfilename @@ -23,30 +24,59 @@ stringerror_message + + Opens a SQLite database or creates the database if it does not exist. + + + + + &reftitle.parameters; + + + + filename + + + The filename of the SQLite database. If the file does not exist, SQLite + will attempt to create it. PHP must have write permissions to the file + if data is inserted, the database schema is modified or to create the + database if it does not exist. + + + + + mode + + + The mode of the file. 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. + + + + + error_message + + + 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. + + + + + + + + + &reftitle.returnvalues; Returns a resource (database handle) 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. - + + + + &reftitle.examples; <function>sqlite_open</function> example @@ -65,6 +95,10 @@ if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { + + + + &reftitle.notes; On Unix platforms, SQLite is sensitive to scripts that use the fork() system call. If you @@ -100,15 +134,20 @@ if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { SQLite is &safemode; and open_basedir aware. - + + + + &reftitle.seealso; - See also sqlite_popen, - sqlite_factory, - sqlite_close and - sqlite_query. + + sqlite_popen + sqlite_close + sqlite_factory + + + sqlite_popen @@ -7,8 +7,9 @@ Opens a persistent handle to an SQLite database and create the database if it does not exist - - Description + + + &reftitle.description; resourcesqlite_popen stringfilename @@ -46,13 +47,66 @@ database file and perform their updates in a transaction. + + + + &reftitle.parameters; - See also sqlite_open, - sqlite_close and - sqlite_query. + + + filename + + + The filename of the SQLite database. If the file does not exist, SQLite + will attempt to create it. PHP must have write permissions to the file + if data is inserted, the database schema is modified or to create the + database if it does not exist. + + + + + mode + + + The mode of the file. 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. + + + + + error_message + + + 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. + + + + + + + + + &reftitle.returnvalues; + + Returns a resource (database handle) on success, &false; on error. + + + + + &reftitle.seealso; + + + sqlite_open + sqlite_close + sqlite_factory + + + sqlite_prev SQLiteResult->prev Seek to the previous row number of a result set - - Description + + + &reftitle.description; boolsqlite_prev resourceresult @@ -22,18 +23,47 @@ sqlite_prev seeks back the - result handle to the previous row. Returns &false; - if there are no more rows, &true; otherwise. + result handle to the previous row. - &sqlite.no-unbuffered; + + + + &reftitle.parameters; - See also - sqlite_has_prev, - sqlite_rewind, and - sqlite_next. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns &true; on success, or &false; if there are no more previous rows. + + + + + &reftitle.seealso; + + + sqlite_has_prev + sqlite_rewind + sqlite_next + + + sqlite_query SQLiteDatabase->query Executes a query against a given database and returns a result handle - - Description + + + &reftitle.description; resourcesqlite_query resourcedbhandle @@ -28,9 +29,39 @@ Executes an SQL statement given by the query against - a given database handle (specified by the dbhandle - parameter). + a given database handle. + + + + &reftitle.parameters; + + + + query + + + The query to be executed. + + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + &sqlite.param-compat; + + + + &reftitle.returnvalues; This function will return a result handle or &false; on failure. For queries that return rows, the result handle can then be used with @@ -50,7 +81,10 @@ recommended that you use the much higher performance sqlite_unbuffered_query instead. - &sqlite.param-compat; + + + + &reftitle.notes; SQLite will execute multiple queries separated by @@ -67,12 +101,19 @@ be &true; for success or it might return a result handle). + + + + &reftitle.seealso; - See also sqlite_unbuffered_query and - sqlite_array_query. + + sqlite_unbuffered_query + sqlite_array_query + + + sqlite_rewind SQLiteResult->rewind Seek to the first row number - - Description + + + &reftitle.description; boolsqlite_rewind resourceresult @@ -22,17 +23,47 @@ 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. + given result set. - &sqlite.no-unbuffered; + + + + &reftitle.parameters; - See also sqlite_next, - sqlite_current, and - sqlite_seek. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns &false; if there are no rows in the result set, &true; otherwise. + + + + + &reftitle.seealso; + + + sqlite_next + sqlite_current + sqlite_seek + + + sqlite_seek SQLiteResult->seek Seek to a particular row number of a buffered result set - - Description + + + &reftitle.description; boolsqlite_seek resourceresult @@ -23,17 +24,57 @@ sqlite_seek seeks to the row given by the parameter - rownum. The row number is zero-based (0 is the - first row). Returns &false; if the row does not exist, &true; otherwise. + rownum. - &sqlite.no-unbuffered; + + + + &reftitle.parameters; - See also sqlite_next, - sqlite_current and - sqlite_rewind. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + rownum + + + The ordinal row number to seek to. The row number is zero-based (0 is + the first row). + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns &false; if the row does not exist, &true; otherwise. + + + + + &reftitle.seealso; + + + sqlite_next + sqlite_current + sqlite_rewind + + + sqlite_single_query @@ -8,8 +8,9 @@ Executes a query and returns either an array for one single column or the value of the first row - - Description + + + &reftitle.description; mixedsqlite_single_query resourcedb diff --git a/reference/sqlite/functions/sqlite-udf-decode-binary.xml b/reference/sqlite/functions/sqlite-udf-decode-binary.xml index b76eb65b4e..e439dc1f74 100644 --- a/reference/sqlite/functions/sqlite-udf-decode-binary.xml +++ b/reference/sqlite/functions/sqlite-udf-decode-binary.xml @@ -1,12 +1,13 @@ - + sqlite_udf_decode_binary Decode binary data passed as parameters to an UDF - - Description + + + &reftitle.description; stringsqlite_udf_decode_binary stringdata @@ -26,6 +27,10 @@ PHP does not perform this encode/decode operation automatically as it would severely impact performance if it did. + + + + &reftitle.examples; binary-safe max_length aggregation function example @@ -73,13 +78,20 @@ var_dump(sqlite_array_query($db, 'SELECT max_len(a) from strings')); + + + + &reftitle.seealso; - See also sqlite_udf_encode_binary, - sqlite_create_function and - sqlite_create_aggregate. + + sqlite_udf_encode_binary + sqlite_create_function + sqlite_create_aggregate + + + sqlite_udf_encode_binary Encode binary data before returning it from an UDF - - Description + + + &reftitle.description; stringsqlite_udf_encode_binary stringdata @@ -33,14 +34,21 @@ sqlite_udf_encode_binary instead! + + + + &reftitle.seealso; - See also sqlite_udf_decode_binary, - sqlite_escape_string, - sqlite_create_function and - sqlite_create_aggregate. + + sqlite_udf_decode_binary + sqlite_escape_string + sqlite_create_function + sqlite_create_aggregate + + + sqlite_unbuffered_query SQLiteDatabase->unbufferedQuery Execute a query that does not prefetch and buffer all data - - Description + + + &reftitle.description; resourcesqlite_unbuffered_query resourcedbhandle @@ -46,12 +47,57 @@ returned from sqlite_unbuffered_query. - &sqlite.param-compat; + + + + &reftitle.parameters; - See also sqlite_query. + + + query + + + The query to be executed. + + + + + dbhandle + + + The SQLite Database resource; returned from sqlite_open + when used procedurally. This parameter is not required + when using the object-oriented method. + + + + + + &sqlite.param-compat; + + + + &reftitle.returnvalues; + + Returns a result handle or &false; on failure. + + + sqlite_unbuffered_query returns a sequential + forward-only result set that can only be used to read each row, one after + the other. + + + + + &reftitle.seealso; + + + sqlite_query + + + sqlite_valid @@ -7,8 +7,9 @@ SQLiteUnbuffered->valid Returns whether more rows are available - - Description + + + &reftitle.description; boolsqlite_valid resourceresult @@ -29,16 +30,47 @@ - sqlite_valid returns &true; if there are more - rows available from the result handle, or &false; - otherwise. + Finds whether more rows are available from the given result handle. + + + + &reftitle.parameters; - See also sqlite_num_rows and - sqlite_changes. + + + result + + + The SQLite result resource. This parameter is not required when using + the object-oriented method. + + &sqlite.no-unbuffered; + + + + + + + + &reftitle.returnvalues; + + Returns &true; if there are more rows available from the + result handle, or &false; otherwise. + + + + + &reftitle.seealso; + + + sqlite_num_rows + sqlite_changes + + +
&reftitle.runtime; &extension.runtime; - SQLite Configuration Options + SQLite &ConfigureOptions; - Name - Default - Changeable + &Name; + &Default; + &Changeable;