From 40243d10c9a8a14e76e96c26545d662eef9fbbad Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Mon, 22 Jan 2007 00:22:11 +0000 Subject: [PATCH] ref.fbsql: switch to new style and document 7 functions git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227795 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../fbsql/functions/fbsql-affected-rows.xml | 30 ++++- .../fbsql/functions/fbsql-autocommit.xml | 63 +++++++--- reference/fbsql/functions/fbsql-blob-size.xml | 45 ++++++- .../fbsql/functions/fbsql-change-user.xml | 57 +++++++-- reference/fbsql/functions/fbsql-clob-size.xml | 45 ++++++- reference/fbsql/functions/fbsql-close.xml | 73 +++++++---- reference/fbsql/functions/fbsql-commit.xml | 46 +++++-- reference/fbsql/functions/fbsql-connect.xml | 93 ++++++++++---- .../fbsql/functions/fbsql-create-blob.xml | 66 +++++++--- .../fbsql/functions/fbsql-create-clob.xml | 66 +++++++--- reference/fbsql/functions/fbsql-create-db.xml | 79 +++++++++--- reference/fbsql/functions/fbsql-data-seek.xml | 55 ++++++--- .../functions/fbsql-database-password.xml | 74 ++++++++---- reference/fbsql/functions/fbsql-database.xml | 32 ++++- reference/fbsql/functions/fbsql-db-query.xml | 59 +++++++-- reference/fbsql/functions/fbsql-db-status.xml | 69 +++++++---- reference/fbsql/functions/fbsql-drop-db.xml | 47 ++++++-- reference/fbsql/functions/fbsql-errno.xml | 63 +++++++--- reference/fbsql/functions/fbsql-error.xml | 62 +++++++--- .../fbsql/functions/fbsql-fetch-array.xml | 93 +++++++++----- .../fbsql/functions/fbsql-fetch-assoc.xml | 73 +++++++---- .../fbsql/functions/fbsql-fetch-field.xml | 59 +++++++-- .../fbsql/functions/fbsql-fetch-lengths.xml | 44 +++++-- .../fbsql/functions/fbsql-fetch-object.xml | 50 +++++--- reference/fbsql/functions/fbsql-fetch-row.xml | 49 +++++--- .../fbsql/functions/fbsql-field-flags.xml | 43 ++++++- reference/fbsql/functions/fbsql-field-len.xml | 39 +++++- .../fbsql/functions/fbsql-field-name.xml | 64 +++++++--- .../fbsql/functions/fbsql-field-seek.xml | 39 +++++- .../fbsql/functions/fbsql-field-table.xml | 32 ++++- .../fbsql/functions/fbsql-field-type.xml | 57 +++++++-- .../fbsql/functions/fbsql-free-result.xml | 25 +++- .../functions/fbsql-get-autostart-info.xml | 17 ++- reference/fbsql/functions/fbsql-hostname.xml | 44 ++++++- reference/fbsql/functions/fbsql-insert-id.xml | 54 ++++++--- reference/fbsql/functions/fbsql-list-dbs.xml | 43 ++++++- .../fbsql/functions/fbsql-list-fields.xml | 78 +++++++++--- .../fbsql/functions/fbsql-list-tables.xml | 48 ++++++-- .../fbsql/functions/fbsql-next-result.xml | 45 +++++-- .../fbsql/functions/fbsql-num-fields.xml | 45 +++++-- reference/fbsql/functions/fbsql-num-rows.xml | 52 ++++++-- reference/fbsql/functions/fbsql-password.xml | 44 ++++++- reference/fbsql/functions/fbsql-pconnect.xml | 71 ++++++++--- reference/fbsql/functions/fbsql-query.xml | 113 +++++++++++------- reference/fbsql/functions/fbsql-read-blob.xml | 76 ++++++++---- reference/fbsql/functions/fbsql-read-clob.xml | 76 ++++++++---- reference/fbsql/functions/fbsql-result.xml | 75 +++++++++--- reference/fbsql/functions/fbsql-rollback.xml | 39 ++++-- reference/fbsql/functions/fbsql-select-db.xml | 66 ++++++---- .../fbsql/functions/fbsql-set-lob-mode.xml | 107 +++++++++++------ .../fbsql/functions/fbsql-set-password.xml | 47 +++++++- .../fbsql/functions/fbsql-set-transaction.xml | 39 +++++- reference/fbsql/functions/fbsql-start-db.xml | 56 +++++++-- reference/fbsql/functions/fbsql-stop-db.xml | 49 ++++++-- reference/fbsql/functions/fbsql-tablename.xml | 54 +++++++-- reference/fbsql/functions/fbsql-username.xml | 46 ++++++- reference/fbsql/functions/fbsql-warnings.xml | 46 +++++-- 57 files changed, 2500 insertions(+), 721 deletions(-) diff --git a/reference/fbsql/functions/fbsql-affected-rows.xml b/reference/fbsql/functions/fbsql-affected-rows.xml index be979ea2ed..7e397860f6 100644 --- a/reference/fbsql/functions/fbsql-affected-rows.xml +++ b/reference/fbsql/functions/fbsql-affected-rows.xml @@ -1,11 +1,12 @@ - + fbsql_affected_rows Get number of affected rows in previous FrontBase operation - + + &reftitle.description; intfbsql_affected_rows @@ -14,9 +15,7 @@ fbsql_affected_rows returns the number of rows affected by the last INSERT, UPDATE or DELETE query - associated with link_identifier. If the - link identifier isn't specified, the last link opened by - fbsql_connect is assumed. + associated with link_identifier. @@ -39,11 +38,30 @@ rows that were literally affected by the query. + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; If the last query failed, this function will return -1. + + + + &reftitle.seealso; - See also: fbsql_num_rows. + + fbsql_num_rows + diff --git a/reference/fbsql/functions/fbsql-autocommit.xml b/reference/fbsql/functions/fbsql-autocommit.xml index ca5b055c64..03fc1380b3 100644 --- a/reference/fbsql/functions/fbsql-autocommit.xml +++ b/reference/fbsql/functions/fbsql-autocommit.xml @@ -1,11 +1,12 @@ - + fbsql_autocommit Enable or disable autocommit - + + &reftitle.description; boolfbsql_autocommit @@ -13,20 +14,54 @@ boolOnOff - fbsql_autocommit returns the current - autocommit status. If the optional OnOff parameter is - given the auto commit status will be changed. - With OnOff set to &true; each statement will be committed - automatically, if no errors was found. - With OnOff set to &false; the user must commit or rollback - the transaction using either fbsql_commit or - fbsql_rollback. - - - See also: fbsql_commit and - fbsql_rollback + Returns the current autocommit status. + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + OnOff + + + If this optional parameter is given the auto commit status will be + changed. + + + With OnOff set to &true; each statement will be + committed automatically, if no errors was found. + + + With OnOff set to &false; the user must commit or rollback the + transaction using either fbsql_commit or + fbsql_rollback. + + + + + + + + + &reftitle.returnvalues; + + Returns the current autocommit status, as a boolean. + + + + + &reftitle.seealso; + + + fbsql_commit + fbsql_rollback + + + + + fbsql_blob_size Get the size of a BLOB - + + &reftitle.description; intfbsql_blob_size stringblob_handle resourcelink_identifier - - &warn.undocumented.func; - + + Returns the size of the given BLOB. + + + + &reftitle.parameters; + + + + blob_handle + + + A BLOB handle, returned by fbsql_create_blob. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns the BLOB size as an integer, or &false; on error. + + + + + &reftitle.seealso; + + + fbsql_clob_size + + + + + fbsql_change_user Change logged in user of the active connection - + + &reftitle.description; - resourcefbsql_change_user + boolfbsql_change_user stringuser stringpassword stringdatabase resourcelink_identifier - fbsql_change_user changes the logged in user - of the current active connection, or the connection given by the - optional parameter link_identifier. If a database is specified, - this will default or current database after the user has been - changed. If the new user and password authorization fails, the - current connected user stays active. + fbsql_change_user changes the logged in user of the + specified connection. If the new user and password authorization fails, + the current connected user stays active. + + + + + &reftitle.parameters; + + + + user + + + The new user name. + + + + + password + + + The new user password. + + + + + database + + + If specified, this will be the default or current database after the + user has been changed. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + &return.success; diff --git a/reference/fbsql/functions/fbsql-clob-size.xml b/reference/fbsql/functions/fbsql-clob-size.xml index dd0cc7207f..579cbcff70 100644 --- a/reference/fbsql/functions/fbsql-clob-size.xml +++ b/reference/fbsql/functions/fbsql-clob-size.xml @@ -1,21 +1,56 @@ - + fbsql_clob_size Get the size of a CLOB - + + &reftitle.description; intfbsql_clob_size stringclob_handle resourcelink_identifier - - &warn.undocumented.func; - + + Returns the size of the given CLOB. + + + + &reftitle.parameters; + + + + clob_handle + + + A CLOB handle, returned by fbsql_create_clob. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns the CLOB size as an integer, or &false; on error. + + + + + &reftitle.seealso; + + + fbsql_blob_size + + + + + fbsql_close Close FrontBase connection - + + &reftitle.description; boolfbsql_close resourcelink_identifier - Returns: &true; on success, &false; on error. - - - fbsql_close closes the connection to the - FrontBase server that's associated with the specified link - identifier. If link_identifier isn't - specified, the last opened link is used. + Closes the connection to the FrontBase server that's associated with the + specified link identifier. Using fbsql_close isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. - - <function>fbsql_close</function> example - - -]]> - - + + + + &reftitle.parameters; - See also: fbsql_connect and - fbsql_pconnect. + + &fbsql.link-identifier.description; + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>fbsql_close</function> example + + +]]> + + + + + + + &reftitle.seealso; + + + fbsql_connect + fbsql_pconnect + + + + + fbsql_commit Commits a transaction to the database - + + &reftitle.description; boolfbsql_commit resourcelink_identifier - &return.success; - - - fbsql_commit ends the current transaction by - writing all inserts, updates and deletes to the disk and - unlocking all row and table locks held by the transaction. This - command is only needed if autocommit is set to false. - - See also: - fbsql_autocommit and - fbsql_rollback + Ends the current transaction by writing all inserts, updates and deletes + to the disk and unlocking all row and table locks held by the transaction. + This command is only needed if autocommit is set to false. + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_autocommit + fbsql_rollback + + + + + fbsql_connect Open a connection to a FrontBase Server - + + &reftitle.description; resourcefbsql_connect @@ -13,16 +14,9 @@ stringusername stringpassword - - Returns a positive FrontBase link identifier on success, or an - error message on failure. - fbsql_connect establishes a connection to a - FrontBase server. The following defaults are assumed for missing - optional parameters: hostname = '&null;', - username = '_SYSTEM' and - password = empty password. + FrontBase server. If a second call is made to fbsql_connect @@ -35,27 +29,80 @@ the script ends, unless it's closed earlier by explicitly calling fbsql_close. - - <function>fbsql_connect</function> example - + + + + &reftitle.parameters; + + + + hostname + + + The server host name. Defaults to '&null;'. + + + + + username + + + The user name for the connection. Defaults to + _SYSTEM. + + + + + password + + + The user name for the connection. Defaults to the empty string. + + + + + + + + + &reftitle.returnvalues; + + Returns a positive FrontBase link identifier on success, or &false; on + errors. + + + + + &reftitle.examples; + + + <function>fbsql_connect</function> example + ]]> - - - - See also - fbsql_pconnect and - fbsql_close. + + + + + &reftitle.seealso; + + + fbsql_pconnect + fbsql_close + + + + + fbsql_create_blob Create a BLOB - + + &reftitle.description; stringfbsql_create_blob @@ -13,16 +14,41 @@ resourcelink_identifier - Returns: A resource handle to the newly created blob. + Creates a BLOB from the given data. + + + + &reftitle.parameters; - fbsql_create_blob creates a blob from - blob_data. The returned resource handle can be used with insert - and update commands to store the blob in the database. + + + blob_data + + + The BLOB data. + + + + &fbsql.link-identifier.description; + - - <function>fbsql_create_blob</function> example - + + + + &reftitle.returnvalues; + + Returns a resource handle to the newly created BLOB, which can be used + with insert and update commands to store the BLOB in the database. + + + + + &reftitle.examples; + + + <function>fbsql_create_blob</function> example + ]]> - - - - See also: fbsql_create_clob, - fbsql_read_blob, - fbsql_read_clob, and - fbsql_set_lob_mode. + + + + + &reftitle.seealso; + + + fbsql_create_clob + fbsql_read_blob + fbsql_read_clob + fbsql_set_lob_mode + + + + + fbsql_create_clob Create a CLOB - + + &reftitle.description; stringfbsql_create_clob @@ -13,16 +14,41 @@ resourcelink_identifier - Returns: A resource handle to the newly created CLOB. + Creates a CLOB from the given data. + + + + &reftitle.parameters; - fbsql_create_clob creates a clob from - clob_data. The returned resource handle can be used with insert - and update commands to store the clob in the database. + + + clob_data + + + The CLOB data. + + + + &fbsql.link-identifier.description; + - - <function>fbsql_create_clob</function> example - + + + + &reftitle.returnvalues; + + Returns a resource handle to the newly created CLOB, which can be used + with insert and update commands to store the CLOB in the database. + + + + + &reftitle.examples; + + + <function>fbsql_create_clob</function> example + ]]> - - - - See also: fbsql_create_blob, - fbsql_read_blob, - fbsql_read_clob, and - fbsql_set_lob_mode. + + + + + &reftitle.seealso; + + + fbsql_create_blob + fbsql_read_blob + fbsql_read_clob + fbsql_set_lob_mode + + + + + fbsql_create_db Create a FrontBase database - + + &reftitle.description; boolfbsql_create_db @@ -14,29 +15,69 @@ stringdatabase_options - fbsql_create_db attempts to create a new - database named database_name on the server - associated with the specified connection - link_identifier. + Attempts to create a new database on the specied server. - - <function>fbsql_create_db</function> example - + + + + &reftitle.parameters; + + + + database_name + + + The database name, as a string. + + + + &fbsql.link-identifier.description; + + database_options + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>fbsql_create_db</function> example + ]]> - - + + + + + + + &reftitle.seealso; - See also: fbsql_drop_db. + + fbsql_drop_db + diff --git a/reference/fbsql/functions/fbsql-data-seek.xml b/reference/fbsql/functions/fbsql-data-seek.xml index b0694870fe..1bb10c84ea 100644 --- a/reference/fbsql/functions/fbsql-data-seek.xml +++ b/reference/fbsql/functions/fbsql-data-seek.xml @@ -1,33 +1,58 @@ - + fbsql_data_seek Move internal result pointer - + + &reftitle.description; boolfbsql_data_seek - resourceresult_identifier + resourceresult introw_number - &return.success; + Moves the internal row pointer of the FrontBase result associated with the + specified result identifier to point to the specified row number. - fbsql_data_seek moves the internal row - pointer of the FrontBase result associated with the specified - result identifier to point to the specified row number. The next - call to fbsql_fetch_row would return that + The next call to fbsql_fetch_row would return that row. + + + + &reftitle.parameters; - Row_number starts at 0. + + &fbsql.result.description; + + row_number + + + The row number. Starts at 0. + + + + - - <function>fbsql_data_seek</function> example - + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>fbsql_data_seek</function> example + =0; $i--) { fbsql_free_result($result); ?> ]]> - - + + + + + fbsql_database_password Sets or retrieves the password for a FrontBase database - + + &reftitle.description; stringfbsql_database_password @@ -13,26 +14,51 @@ stringdatabase_password - Returns: The database password associated with the link identifier. + Sets and retrieves the database password used by the connection. If a + database is protected by a database password, the user must call this + function before calling fbsql_select_db. - fbsql_database_password sets and retrieves - the database password used by the connection. if a database is - protected by a database password, the user must call this function - before calling fbsql_select_db. if the second - optional parameter is given the function sets the database - password for the specified link identifier. If no link identifier is - specified, the last opened link is assumed. If no link is open, - the function will try to establish a link as if + If no link is open, the function will try to establish a link as if fbsql_connect was called, and use it. This function does not change the database password in the database nor can it be used to retrieve the database password for a database. - - <function>fbsql_create_clob</function> example - + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + database_password + + + The database password, as a string. If given, the function sets the + database password for the specified link identifier. + + + + + + + + + &reftitle.returnvalues; + + Returns the database password associated with the link identifier. + + + + + &reftitle.examples; + + + <function>fbsql_create_clob</function> example + ]]> - - - - See also: fbsql_connect, - fbsql_pconnect and - fbsql_select_db. + + + + + &reftitle.seealso; + + + fbsql_connect + fbsql_pconnect + fbsql_select_db + + + + + fbsql_database Get or set the database name used with a connection - + + &reftitle.description; stringfbsql_database @@ -13,7 +14,32 @@ stringdatabase - &warn.undocumented.func; + Get or set the database name used with the connection. + + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + database + + + The database name. If given, the default database of the connexion + will be changed to database. + + + + + + + + + &reftitle.returnvalues; + + Returns the name of the database used with this connection. diff --git a/reference/fbsql/functions/fbsql-db-query.xml b/reference/fbsql/functions/fbsql-db-query.xml index 0152ef7f9a..91504918d5 100644 --- a/reference/fbsql/functions/fbsql-db-query.xml +++ b/reference/fbsql/functions/fbsql-db-query.xml @@ -1,11 +1,12 @@ - + fbsql_db_query Send a FrontBase query - + + &reftitle.description; resourcefbsql_db_query @@ -14,19 +15,55 @@ resourcelink_identifier - Returns: A positive FrontBase result identifier to the query - result, or &false; on error. + Selects a database and executes a query on it. + + + + &reftitle.parameters; - fbsql_db_query selects a database and - executes a query on it. If the optional link identifier isn't - specified, the function will try to find an open link to the - FrontBase server and if no such link is found it'll try to create - one as if fbsql_connect was called with no - arguments + + + database + + + The database to be selected. + + + + + query + + + The SQL query to be executed. + + + + The query string shall always end with a semicolon. + + + + + &fbsql.link-identifier.description; + + + + + &reftitle.returnvalues; - See also fbsql_connect. + Returns a positive FrontBase result identifier to the query result, or + &false; on error. + + + + + &reftitle.seealso; + + + fbsql_query + fbsql_connect + diff --git a/reference/fbsql/functions/fbsql-db-status.xml b/reference/fbsql/functions/fbsql-db-status.xml index 3c0584c54f..4068e67b25 100644 --- a/reference/fbsql/functions/fbsql-db-status.xml +++ b/reference/fbsql/functions/fbsql-db-status.xml @@ -1,11 +1,12 @@ - + fbsql_db_status Get the status for a given database - + + &reftitle.description; intfbsql_db_status @@ -13,66 +14,88 @@ resourcelink_identifier - Returns: An integer value with the current status. + Gets the current status of the specified database. + + + + &reftitle.parameters; - fbsql_db_status requests the current status - of the database specified by - database_name. If the - link_identifier is omitted the default - link_identifier will be used. + + + database_name + + + The database name. + + + + &fbsql.link-identifier.description; + + + + + &reftitle.returnvalues; - The return value can be one of the following constants: + Returns an integer value with the current status. This can be one of the + following constants: - &false; - The exec handler for the host was invalid. This - error will occur when the link_identifier connects directly to - a database by using a port number. FBExec can be available on - the server but no connection has been made for it. + &false; - The exec handler for the host was invalid. This error will + occur when the link_identifier connects directly + to a database by using a port number. FBExec can be available on the + server but no connection has been made for it. - FBSQL_UNKNOWN - The Status is unknown. + FBSQL_UNKNOWN - The Status is unknown. - FBSQL_STOPPED - The database is not running. Use + FBSQL_STOPPED - The database is not running. Use fbsql_start_db to start the database. - FBSQL_STARTING - The database is starting. + FBSQL_STARTING - The database is starting. - FBSQL_RUNNING - The database is running and can be used to - perform SQL operations. + FBSQL_RUNNING - The database is running and can be + used to perform SQL operations. - FBSQL_STOPPING - The database is stopping. + FBSQL_STOPPING - The database is stopping. - FBSQL_NOEXEC - FBExec is not running on the server and it is not - possible to get the status of the database. + FBSQL_NOEXEC - FBExec is not running on the server + and it is not possible to get the status of the database. + + + + &reftitle.seealso; - See also: fbsql_start_db and - fbsql_stop_db. + + fbsql_start_db + fbsql_stop_db + + + fbsql_drop_db Drop (delete) a FrontBase database - + + &reftitle.description; boolfbsql_drop_db @@ -13,14 +14,44 @@ resourcelink_identifier - &return.success; - - - fbsql_drop_db attempts to drop (remove) an - entire database from the server associated with the specified - link identifier. + fbsql_drop_db attempts to drop (remove) an entire + database from the server associated with the specified link identifier. + + + &reftitle.parameters; + + + + database_name + + + The database name, as a string. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_create_db + + + + + fbsql_errno - Returns the numerical value of the error message from previous FrontBase operation + Returns the error number from previous operation - + + &reftitle.description; intfbsql_errno resourcelink_identifier + + Returns the numerical value of the error message from previous FrontBase + operation. + + + Errors coming back from the fbsql database backend don't issue warnings. + Instead, use fbsql_errno to retrieve the error code. + Note that this function only returns the error code from the most recently + executed fbsql function (not including fbsql_error + and fbsql_errno), so if you want to use it, make sure + you check the value before calling another fbsql function. + + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; Returns the error number from the last fbsql function, or 0 (zero) if no error occurred. + + + + &reftitle.examples; - Errors coming back from the fbsql database backend don't issue - warnings. Instead, use fbsql_errno to - retrieve the error code. Note that this function only returns the - error code from the most recently executed fbsql function (not - including fbsql_error and - fbsql_errno), so if you want to use it, make - sure you check the value before calling another fbsql function. - + + <function>fbsql_errno</function> Example "; ?> ]]> - - - - See also: fbsql_error and - fbsql_warnings. + + + + &reftitle.seealso; + + + fbsql_error + fbsql_warnings + + + + + fbsql_error - Returns the text of the error message from previous FrontBase operation + Returns the error message from previous operation - + + &reftitle.description; stringfbsql_error resourcelink_identifier + + Returns the error message from previous FrontBase operation. + + + Errors coming back from the fbsql database backend don't issue warnings. + Instead, use fbsql_error to retrieve the error text. + Note that this function only returns the error code from the most recently + executed fbsql function (not including fbsql_error + and fbsql_errno), so if you want to use it, make sure + you check the value before calling another fbsql function. + + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; Returns the error text from the last fbsql function, or '' (the empty string) if no error occurred. + + + + &reftitle.examples; - Errors coming back from the fbsql database backend don't issue - warnings. Instead, use fbsql_error to - retrieve the error text. Note that this function only returns the - error text from the most recently executed fbsql function (not - including fbsql_error and - fbsql_errno), so if you want to use it, make - sure you check the value before calling another fbsql function. - + + <function>fbsql_error</function> Example "; ?> ]]> - - - - See also: fbsql_errno and - fbsql_warnings. + + + + &reftitle.seealso; + + + fbsql_errno + fbsql_warnings + + + + + fbsql_fetch_array Fetch a result row as an associative array, a numeric array, or both - + + &reftitle.description; arrayfbsql_fetch_array @@ -13,14 +14,47 @@ intresult_type - Returns an array that corresponds to the fetched row, or &false; - if there are no more rows. + fbsql_fetch_array is a combination of + fbsql_fetch_row and + fbsql_fetch_assoc. - fbsql_fetch_array is an extended version of - fbsql_fetch_row. In addition to storing the - data in the numeric indices of the result array, it also stores - the data in associative indices, using the field names as keys. + An important thing to note is that using + fbsql_fetch_array is NOT significantly + slower than using fbsql_fetch_row, while it + provides a significant added value. + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + result_type + + + A constant and can take the following values: + FBSQL_ASSOC, FBSQL_NUM, or + FBSQL_BOTH. + + + When using FBSQL_BOTH, in addition to storing the + data in the numeric indices of the result array, it also stores the + data in associative indices, using the field names as keys. + + + + + + + + + &reftitle.returnvalues; + + Returns an array that corresponds to the fetched row, or &false; + if there are no more rows. If two or more columns of the result have the same field names, @@ -35,26 +69,14 @@ select t1.f1 as foo t2.f1 as bar from t1, t2 + + + + &reftitle.examples; - An important thing to note is that using - fbsql_fetch_array is NOT significantly - slower than using fbsql_fetch_row, while it - provides a significant added value. - - - The optional second argument result_type - in fbsql_fetch_array is a constant and can - take the following values: FBSQL_ASSOC, FBSQL_NUM, and - FBSQL_BOTH. - - - For further details, see also - fbsql_fetch_row and - fbsql_fetch_assoc. - - - <function>fbsql_fetch_array</function> example - + + <function>fbsql_fetch_array</function> example + ]]> - - + + + + + + &reftitle.seealso; + + + fbsql_fetch_row + fbsql_fetch_assoc + fbsql_fetch_object + + + + + fbsql_fetch_assoc Fetch a result row as an associative array - + + &reftitle.description; arrayfbsql_fetch_assoc resourceresult - Returns an associative array that corresponds to the fetched row, - or &false; if there are no more rows. + Calling fbsql_fetch_assoc is equivalent to calling + fbsql_fetch_array with + FBSQL_ASSOC as second parameter. It only returns an + associative array. + - fbsql_fetch_assoc is equivalent to calling - fbsql_fetch_array with FBSQL_ASSOC for the - optional second parameter. It only returns an associative array. This is the way fbsql_fetch_array originally worked. If you need the numeric indices as well as the associative, use fbsql_fetch_array. - - If two or more columns of the result have the same field names, - the last column will take precedence. To access the other column(s) - of the same name, you must use fbsql_fetch_array and - have it return the numeric indices as well. - An important thing to note is that using fbsql_fetch_assoc is NOT significantly slower than using fbsql_fetch_row, while it provides a significant added value. + + + + &reftitle.parameters; - For further details, see also - fbsql_fetch_row and - fbsql_fetch_array. + + &fbsql.result.description; + - - <function>fbsql_fetch_assoc</function> example - + + + + &reftitle.returnvalues; + + Returns an associative array that corresponds to the fetched row, or + &false; if there are no more rows. + + + If two or more columns of the result have the same field names, the last + column will take precedence. To access the other column(s) of the same + name, you must use fbsql_fetch_array and have it + return the numeric indices as well. + + + + + &reftitle.examples; + + + <function>fbsql_fetch_assoc</function> example + ]]> - - + + + + + + &reftitle.seealso; + + + fbsql_fetch_row + fbsql_fetch_array + fbsql_fetch_object + + + + + fbsql_fetch_field Get column information from a result and return as an object - + + &reftitle.description; objectfbsql_fetch_field @@ -13,13 +14,33 @@ intfield_offset - Returns an object containing field information. + Used in order to obtain information about fields in a certain query result. + + + + &reftitle.parameters; - fbsql_fetch_field can be used in order to - obtain information about fields in a certain query result. If - the field offset isn't specified, the next field that wasn't yet - retrieved by fbsql_fetch_field is retrieved. + + &fbsql.result.description; + + field_offset + + + The numerical offset of the field. The field index starts at 0. + If not specified, the next field that wasn't yet retrieved by + fbsql_fetch_field is retrieved. + + + + + + + + + &reftitle.returnvalues; + + Returns an object containing field information, or &false; on errors. The properties of the object are: @@ -51,9 +72,14 @@ - - <function>fbsql_fetch_field</function> example - + + + + &reftitle.examples; + + + <function>fbsql_fetch_field</function> example + type fbsql_free_result($result); ?> ]]> - - + + + + + + + &reftitle.seealso; - See also fbsql_field_seek. + + fbsql_field_seek + diff --git a/reference/fbsql/functions/fbsql-fetch-lengths.xml b/reference/fbsql/functions/fbsql-fetch-lengths.xml index abff667575..e54858c5da 100644 --- a/reference/fbsql/functions/fbsql-fetch-lengths.xml +++ b/reference/fbsql/functions/fbsql-fetch-lengths.xml @@ -1,31 +1,49 @@ - + fbsql_fetch_lengths Get the length of each output in a result - + + &reftitle.description; arrayfbsql_fetch_lengths resourceresult - Returns: An array that corresponds to the lengths of each field - in the last row fetched by fbsql_fetch_row, + Stores the lengths of each result column in the last row returned by + fbsql_fetch_row, + fbsql_fetch_array and + fbsql_fetch_object in an array. + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + Returns an array, starting at offset 0, that corresponds to the lengths of + each field in the last row fetched by fbsql_fetch_row, or &false; on error. + + + + &reftitle.seealso; - fbsql_fetch_lengths stores the lengths of - each result column in the last row returned by - fbsql_fetch_row, - fbsql_fetch_array and - fbsql_fetch_object in an array, starting at - offset 0. - - - See also: fbsql_fetch_row. + + fbsql_fetch_row + diff --git a/reference/fbsql/functions/fbsql-fetch-object.xml b/reference/fbsql/functions/fbsql-fetch-object.xml index ded6247f4a..9362b481e2 100644 --- a/reference/fbsql/functions/fbsql-fetch-object.xml +++ b/reference/fbsql/functions/fbsql-fetch-object.xml @@ -1,21 +1,17 @@ - + fbsql_fetch_object Fetch a result row as an object - + + &reftitle.description; objectfbsql_fetch_object resourceresult - intresult_type - - Returns an object with properties that correspond to the fetched - row, or &false; if there are no more rows. - fbsql_fetch_object is similar to fbsql_fetch_array, with one difference - an @@ -23,16 +19,34 @@ that you can only access the data by the field names, and not by their offsets (numbers are illegal property names). - - The optional argument result_type is a - constant and can take the following values: FBSQL_ASSOC, - FBSQL_NUM, and FBSQL_BOTH. - Speed-wise, the function is identical to fbsql_fetch_array, and almost as quick as fbsql_fetch_row (the difference is insignificant). + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + Returns an object with properties that correspond to the fetched row, or + &false; if there are no more rows. + + + + + &reftitle.examples; + <function>fbsql_fetch_object</function> example @@ -50,11 +64,19 @@ fbsql_free_result($result); + + + + &reftitle.seealso; - See also: fbsql_fetch_array and - fbsql_fetch_row. + + fbsql_fetch_array + fbsql_fetch_row + fbsql_fetch_assoc + + + fbsql_fetch_row Get a result row as an enumerated array - + + &reftitle.description; arrayfbsql_fetch_row resourceresult - - Returns: An array that corresponds to the fetched row, or &false; - if there are no more rows. - fbsql_fetch_row fetches one row of data from - the result associated with the specified result identifier. The - row is returned as an array. Each result column is stored in an - array offset, starting at offset 0. + the result associated with the specified result identifier. Subsequent call to fbsql_fetch_row would return the next row in the result set, or &false; if there are no more rows. + + + + &reftitle.parameters; - See also: fbsql_fetch_array, - fbsql_fetch_object, - fbsql_data_seek, - fbsql_fetch_lengths, and - fbsql_result. + + &fbsql.result.description; + + + + &reftitle.returnvalues; + + Returns an array that corresponds to the fetched row where each result + column is stored in an offset, starting at offset 0, or &false; if there + are no more rows. + + + + + &reftitle.seealso; + + + fbsql_fetch_array + fbsql_fetch_assoc + fbsql_fetch_object + fbsql_data_seek + fbsql_fetch_lengths + fbsql_result + + + + + fbsql_field_flags Get the flags associated with the specified field in a result - + + &reftitle.description; stringfbsql_field_flags @@ -13,10 +14,40 @@ intfield_offset - fbsql_field_flags returns the field flags of - the specified field. The flags are reported as a single word - per flag separated by a single space, so that you can split the - returned value using explode. + Gets the flags associated with the specified field in a result. + + + + + &reftitle.parameters; + + + + result + + + A result pointer returned by fbsql_list_fields. + + + + + field_offset + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + Returns the field flags of the specified field as a single word per flag + separated by a single space, so that you can split the returned value + using explode. diff --git a/reference/fbsql/functions/fbsql-field-len.xml b/reference/fbsql/functions/fbsql-field-len.xml index 412f31827a..829ceb42d4 100644 --- a/reference/fbsql/functions/fbsql-field-len.xml +++ b/reference/fbsql/functions/fbsql-field-len.xml @@ -1,11 +1,12 @@ - + fbsql_field_len Returns the length of the specified field - + + &reftitle.description; intfbsql_field_len @@ -13,8 +14,38 @@ intfield_offset - fbsql_field_len returns the length of the - specified field. + Returns the length of the specified field. + + + + + &reftitle.parameters; + + + + result + + + A result pointer returned by fbsql_list_fields. + + + + + field_offset + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + Returns the length of the specified field. diff --git a/reference/fbsql/functions/fbsql-field-name.xml b/reference/fbsql/functions/fbsql-field-name.xml index dde56c5007..4f68c38804 100644 --- a/reference/fbsql/functions/fbsql-field-name.xml +++ b/reference/fbsql/functions/fbsql-field-name.xml @@ -1,11 +1,12 @@ - + fbsql_field_name Get the name of the specified field in a result - + + &reftitle.description; stringfbsql_field_name @@ -13,20 +14,43 @@ intfield_index - fbsql_field_name returns the name of the - specified field index. result must be a - valid result identifier and field_index is - the numerical offset of the field. + Returns the name of the specified field index. - - - field_index starts at 0. - - - e.g. The index of the third field would actually be 2, the index - of the fourth field would be 3 and so on. - - + + + + &reftitle.parameters; + + + + result + + + A result pointer returned by fbsql_list_fields. + + + + + field_index + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + Returns the name as a string, or &false; if the field doesn't exist. + + + + + &reftitle.examples; <function>fbsql_field_name</function> example @@ -55,6 +79,16 @@ password + + + &reftitle.seealso; + + + fbsql_field_type + + + + + fbsql_field_seek Set result pointer to a specified field offset - + + &reftitle.description; boolfbsql_field_seek @@ -13,13 +14,43 @@ intfield_offset - Seeks to the specified field offset. If the next call to + Seeks to the specified field offset. If the next call to fbsql_fetch_field doesn't include a field offset, the field offset specified in fbsql_field_seek will be returned. + + + + &reftitle.parameters; - See also: fbsql_fetch_field. + + &fbsql.result.description; + + field_offset + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_fetch_field + diff --git a/reference/fbsql/functions/fbsql-field-table.xml b/reference/fbsql/functions/fbsql-field-table.xml index 1e59230d5c..832fa69b36 100644 --- a/reference/fbsql/functions/fbsql-field-table.xml +++ b/reference/fbsql/functions/fbsql-field-table.xml @@ -1,11 +1,12 @@ - + fbsql_field_table Get name of the table the specified field is in - + + &reftitle.description; stringfbsql_field_table @@ -13,8 +14,31 @@ intfield_offset - Returns the name of the table that the specified field is - in. + Returns the name of the table that the specified field is in. + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + field_offset + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + Returns the name of the table, as a string. diff --git a/reference/fbsql/functions/fbsql-field-type.xml b/reference/fbsql/functions/fbsql-field-type.xml index 1a7ac8c9dd..4b66029e07 100644 --- a/reference/fbsql/functions/fbsql-field-type.xml +++ b/reference/fbsql/functions/fbsql-field-type.xml @@ -1,11 +1,12 @@ - + fbsql_field_type Get the type of the specified field in a result - + + &reftitle.description; stringfbsql_field_type @@ -14,11 +15,43 @@ fbsql_field_type is similar to the - fbsql_field_name function. The arguments are - identical, but the field type is returned instead. The field type - will be one of "int", "real", "string", "blob", and others as - detailed in the FrontBase - documentation. + fbsql_field_name function, but the field type is + returned instead. + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + field_offset + + + The numerical offset of the field. The field index starts at 0. + + + + + + + + + &reftitle.returnvalues; + + Returns the field type, as a string. + + + This can be one of int, real, + string, blob, and others as detailed + in the FrontBase documentation. + + + + + &reftitle.examples; + <function>fbsql_field_type</function> example @@ -50,6 +83,16 @@ fbsql_close(); + + + &reftitle.seealso; + + + fbsql_field_name + + + + + fbsql_free_result Free result memory - + + &reftitle.description; boolfbsql_free_result resourceresult - fbsql_free_result will free all memory - associated with the result identifier result. + Frees all memory associated with the given result + identifier. fbsql_free_result only needs to be called if @@ -22,6 +23,22 @@ automatically freed at the end of the script's execution. + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + &return.success; + + + fbsql_get_autostart_info - No description given yet + - + + &reftitle.description; arrayfbsql_get_autostart_info resourcelink_identifier + &warn.undocumented.func; + + + + &reftitle.parameters; - &warn.undocumented.func; + + &fbsql.link-identifier.description; + + + fbsql_hostname Get or set the host name used with a connection - + + &reftitle.description; stringfbsql_hostname resourcelink_identifier stringhost_name - &warn.undocumented.func; + + Gets or sets the host name used with a connection. + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + host_name + + + If provided, this will be the new connection host name. + + + + + + + + + &reftitle.returnvalues; + + Returns the current host name used for the connection. + + + + + &reftitle.seealso; + + + fbsql_username + fbsql_password + + + + + fbsql_insert_id Get the id generated from the previous INSERT operation - + + &reftitle.description; intfbsql_insert_id resourcelink_identifier - fbsql_insert_id returns the ID generated for - an column defined as DEFAULT UNIQUE by the previous INSERT query - using the given link_identifier. If - link_identifier isn't specified, the last - opened link is assumed. - - - fbsql_insert_id returns 0 if the previous - query does not generate an DEFAULT UNIQUE value. If you need to - save the value for later, be sure to call fbsql_insert_id() - immediately after the query that generates the value. + Gets the id generated from the previous INSERT operation which created a + DEFAULT UNIQUE value. The value of the FrontBase SQL function - fbsql_insert_id always contains the most - recently generated DEFAULT UNIQUE value, and is not reset - between queries. + fbsql_insert_id always contains the most recently + generated DEFAULT UNIQUE value, and is not reset between queries. + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns the ID generated from the previous INSERT query, or 0 if the + previous query does not generate an DEFAULT UNIQUE value. + + + If you need to save the value for later, be sure to call this function + immediately after the query that generates the value. + + + + + &reftitle.seealso; + + + fbsql_affected_rows + + + + + fbsql_list_dbs List databases available on a FrontBase server - + + &reftitle.description; resourcefbsql_list_dbs resourcelink_identifier - fbsql_list_dbs will return a result pointer - containing the databases available from the current fbsql - daemon. Use the fbsql_tablename function to + Return a result pointer containing the databases available from the + current fbsql daemon. Use the fbsql_tablename to traverse this result pointer. + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns a result pointer or &false; on error. + + + + + &reftitle.examples; <function>fbsql_list_dbs</function> example @@ -30,7 +50,7 @@ while ($row = fbsql_fetch_object($db_list)) { } ]]> - &example.outputs; + &example.outputs.similar; + + + &reftitle.seealso; + + + fbsql_list_fields + fbsql_list_tables + + + + + fbsql_list_fields List FrontBase result fields - + + &reftitle.description; resourcefbsql_list_fields @@ -14,21 +15,55 @@ resourcelink_identifier - fbsql_list_fields retrieves information - about the given tablename. Arguments are the database name and - the table name. A result pointer is returned which can be used - with fbsql_field_flags, - fbsql_field_len, - fbsql_field_name, and - fbsql_field_type. + Retrieves information about the given table. + + + + &reftitle.parameters; - A result identifier is a positive integer. The function returns - &false; if an error occurs. A string describing the error will be - placed in $phperrmsg, and unless the function - was called as @fbsql() then this error string - will also be printed out. + + + database_name + + + The database name. + + + + + table_name + + + The table name. + + + + &fbsql.link-identifier.description; + + + + + &reftitle.returnvalues; + + Returns a result pointer which can be used with the + fbsql_field_xxx functions, or &false; on error. + + + + + &reftitle.errors; + + A string describing the error will be placed in + $phperrmsg, and unless the function was called as + @fbsql() then this error string will also be printed + out. + + + + + &reftitle.examples; <function>fbsql_list_fields</function> example @@ -46,7 +81,7 @@ for ($i = 0; $i < $columns; $i++) { ?> ]]> - &example.outputs; + &example.outputs.similar; + + + &reftitle.seealso; + + + fbsql_field_len + fbsql_field_name + fbsql_field_type + fbsql_field_flags + + + + + fbsql_list_tables List tables in a FrontBase database - + + &reftitle.description; resourcefbsql_list_tables @@ -13,13 +14,46 @@ resourcelink_identifier - fbsql_list_tables takes a database name and - returns a result pointer much like the - fbsql_db_query function. The - fbsql_tablename function should be used to - extract the actual table names from the result pointer. + Returns a result pointer describing the database. + + + &reftitle.parameters; + + + + database + + + The database name. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns a result pointer which can be used with the + fbsql_tablename function to read the actual table + names, or &false; on error. + + + + + &reftitle.seealso; + + + fbsql_list_fields + fbsql_list_dbs + + + + + fbsql_next_result Move the internal result pointer to the next result - + + &reftitle.description; boolfbsql_next_result - resourceresult_id + resourceresult When sending more than one SQL statement to the server or @@ -17,13 +18,33 @@ server to return multiple result sets. This function will test for additional results available form the server. If an additional result set exists it will free the existing result set - and prepare to fetch the words from the new result set. The - function will return &true; if an additional result set was - available or &false; otherwise. + and prepare to fetch the words from the new result set. - - <function>fbsql_next_result</function> example - + + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + Returns &true; if an additional result set was available or &false; + otherwise. + + + + + &reftitle.examples; + + + <function>fbsql_next_result</function> example + ]]> - - + + + + + fbsql_num_fields Get number of fields in result - + + &reftitle.description; intfbsql_num_fields resourceresult - fbsql_num_fields returns the number of - fields in a result set. - - - See also: - fbsql_db_query, - fbsql_query, - fbsql_fetch_field, and - fbsql_num_rows. + Returns the number of fields in the given result + set. + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + Returns the number of fields, as an integer. + + + + + &reftitle.seealso; + + + fbsql_db_query + fbsql_query + fbsql_fetch_field + fbsql_num_rows + + + + + fbsql_num_rows Get number of rows in result - + + &reftitle.description; intfbsql_num_rows resourceresult - fbsql_num_rows returns the number of rows in - a result set. This command is only valid for SELECT statements. - To retrieve the number of rows returned from a INSERT, UPDATE or - DELETE query, use fbsql_affected_rows. + Gets the number of rows in the given result set. + + + This function is only valid for SELECT statements. To retrieve the number + of rows returned from a INSERT, UPDATE or DELETE query, use + fbsql_affected_rows. + + + + + &reftitle.parameters; + + + &fbsql.result.description; + + + + + + &reftitle.returnvalues; + + Returns the number of rows returned by the last SELECT statement. + + + + + &reftitle.examples; + <function>fbsql_num_rows</function> example @@ -35,13 +60,20 @@ echo "$num_rows Rows\n"; + + + + &reftitle.seealso; - See also: fbsql_affected_rows, - fbsql_connect, - fbsql_select_db, and - fbsql_query. + + fbsql_affected_rows + fbsql_connect + fbsql_select_db + fbsql_query + + + fbsql_password Get or set the user password used with a connection - + + &reftitle.description; stringfbsql_password resourcelink_identifier stringpassword - &warn.undocumented.func; + + Get or set the user password used with a connection. + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + password + + + If provided, this will be the new connection password. + + + + + + + + + &reftitle.returnvalues; + + Returns the current password used for the connection. + + + + + &reftitle.seealso; + + + fbsql_username + fbsql_hostname + + + + + fbsql_pconnect Open a persistent connection to a FrontBase Server - + + &reftitle.description; resourcefbsql_pconnect @@ -14,23 +15,14 @@ stringpassword - Returns: A positive FrontBase persistent link identifier on - success, or &false; on error. + Establishes a persistent connection to a FrontBase server. - fbsql_pconnect establishes a connection - to a FrontBase server. The following defaults are assumed for - missing optional parameters: host = - 'localhost', username = "_SYSTEM" - and password = empty password. - - - To set Frontbase server port number, use - fbsql_select_db. + To set the server port number, use fbsql_select_db. fbsql_pconnect acts very much like - fbsql_connect with two major differences. + fbsql_connect with two major differences: First, when connecting, the function would first try to find a @@ -47,6 +39,57 @@ This type of links is therefore called 'persistent'. + + + &reftitle.parameters; + + + + hostname + + + The server host name. Defaults to localhost. + + + + + username + + + The user name for the connection. Defaults to + _SYSTEM. + + + + + password + + + The user name for the connection. Defaults to the empty string. + + + + + + + + + &reftitle.returnvalues; + + Returns a positive FrontBase persistent link identifier on success, or + &false; on error. + + + + + &reftitle.seealso; + + + fbsql_connect + + + + + fbsql_query Send a FrontBase query - + + &reftitle.description; resourcefbsql_query @@ -14,19 +15,48 @@ intbatch_size - fbsql_query sends a query to the currently - active database on the server that's associated with the - specified link identifier. If - link_identifier isn't specified, the last - opened link is assumed. If no link is open, the function tries - to establish a link as if fbsql_connect was - called with no arguments, and use it. + Sends a query to the currently active database on + the server. - - - The query string shall always end with a semicolon. - - + + If the query succeeds, you can call fbsql_num_rows to + find out how many rows were returned for a SELECT statement or + fbsql_affected_rows to find out how many rows were + affected by a DELETE, INSERT, REPLACE, or UPDATE statement. + + + + + &reftitle.parameters; + + + + query + + + The SQL query to be executed. + + + + The query string shall always end with a semicolon. + + + + + &fbsql.link-identifier.description; + + batch_size + + + + + + + + + + + &reftitle.returnvalues; fbsql_query returns &true; (non-zero) or &false; to indicate whether or not the query succeeded. A return value @@ -36,6 +66,18 @@ to succeed but affect no rows or return no rows. + For SELECT statements, fbsql_query returns a new + result identifier that you can pass to fbsql_result. + + + fbsql_query will also fail and return &false; if you + don't have permission to access the table(s) referenced by the query. + + + + + &reftitle.examples; + The following query is syntactically invalid, so fbsql_query fails and returns &false;: @@ -60,44 +102,29 @@ $result = fbsql_query("SELECT * WHERE 1=1") ]]> + + + + &reftitle.seealso; - fbsql_query will also fail and return - &false; if you don't have permission to access the table(s) - referenced by the query. - - - Assuming the query succeeds, you can call - fbsql_num_rows to find out how many rows - were returned for a SELECT statement or - fbsql_affected_rows to find out how many - rows were affected by a DELETE, INSERT, REPLACE, or UPDATE - statement. - - - For SELECT statements, fbsql_query returns a - new result identifier that you can pass to - fbsql_result. When you are done with the - result set, you can free the resources associated with it by - calling fbsql_free_result. Although, the - memory will automatically be freed at the end of the script's - execution. - - - See also: fbsql_affected_rows, - fbsql_db_query, - fbsql_free_result, - fbsql_result, - fbsql_select_db, and - fbsql_connect. + + fbsql_affected_rows + fbsql_db_query + fbsql_free_result + fbsql_result + fbsql_select_db + fbsql_connect + + + fbsql_read_blob Read a BLOB from the database - + + &reftitle.description; stringfbsql_read_blob @@ -13,21 +14,48 @@ resourcelink_identifier - Returns: A string containing the BLOB specified by blob_handle. + Reads BLOB data from the database. - fbsql_read_blob reads BLOB data from the - database. If a select statement contains BLOB and/or CLOB - columns FrontBase will return the data directly when data is - fetched. This default behavior can be changed with - fbsql_set_lob_mode so the fetch functions - will return handles to BLOB and CLOB data. If a handle is - fetched a user must call fbsql_read_blob to - get the actual BLOB data from the database. + If a select statement contains BLOB and/or CLOB columns FrontBase will + return the data directly when data is fetched. This default behavior can + be changed with fbsql_set_lob_mode so the fetch + functions will return handles to BLOB and CLOB data. If a handle is + fetched a user must call fbsql_read_blob to get the + actual BLOB data from the database. - - <function>fbsql_read_blob</function> example - + + + + &reftitle.parameters; + + + + blob_handle + + + A BLOB handle, returned by fbsql_create_blob. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns a string containing the specified BLOB data. + + + + + &reftitle.examples; + + + <function>fbsql_read_blob</function> example + ]]> - - - - See also: fbsql_create_blob, - fbsql_read_clob, and - fbsql_set_lob_mode. + + + + + &reftitle.seealso; + + + fbsql_create_blob + fbsql_read_clob + fbsql_set_lob_mode + + + + + fbsql_read_clob Read a CLOB from the database - + + &reftitle.description; stringfbsql_read_clob @@ -13,21 +14,48 @@ resourcelink_identifier - Returns: A string containing the CLOB specified by clob_handle. + Reads CLOB data from the database. - fbsql_read_clob reads CLOB data from the - database. If a select statement contains BLOB and/or CLOB - columns FrontBase will return the data directly when data is - fetched. This default behavior can be changed with - fbsql_set_lob_mode so the fetch functions - will return handles to BLOB and CLOB data. If a handle is - fetched a user must call fbsql_read_clob to - get the actual CLOB data from the database. + If a select statement contains BLOB and/or CLOB columns FrontBase will + return the data directly when data is fetched. This default behavior can + be changed with fbsql_set_lob_mode so the fetch + functions will return handles to BLOB and CLOB data. If a handle is + fetched a user must call fbsql_read_clob to get the + actual CLOB data from the database. - - <function>fbsql_read_clob</function> example - + + + + &reftitle.parameters; + + + + clob_handle + + + A CLOB handle, returned by fbsql_create_clob. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + Returns a string containing the specified CLOB data. + + + + + &reftitle.examples; + + + <function>fbsql_read_clob</function> example + ]]> - - - - See also: fbsql_create_blob, - fbsql_read_blob, and - fbsql_set_lob_mode. + + + + + &reftitle.seealso; + + + fbsql_create_clob + fbsql_read_blob + fbsql_set_lob_mode + + + + + fbsql_result Get result data - + + &reftitle.description; mixedfbsql_result @@ -14,33 +15,75 @@ mixedfield - fbsql_result returns the contents of one - cell from a FrontBase result set. The field argument can be the - field's offset, or the field's name, or the field's table dot - field's name (tabledname.fieldname). If the column name has been - aliased ('select foo as bar from...'), use the alias instead of - the column name. + Returns the contents of one cell from a FrontBase + result set. When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these functions return the contents of multiple cells in one - function call, they're MUCH quicker than - fbsql_result. Also, note that specifying a - numeric offset for the field argument is much quicker than - specifying a fieldname or tablename.fieldname argument. + function call, they're MUCH quicker than fbsql_result. Calls to fbsql_result should not be mixed with calls to other functions that deal with the result set. + + + + &reftitle.parameters; - Recommended high-performance alternatives: - fbsql_fetch_row, - fbsql_fetch_array, and - fbsql_fetch_object. + + &fbsql.result.description; + + row + + + + + + + field + + + Can be the field's offset, or the field's name, or the field's table + dot field's name (tabledname.fieldname). + + + If the column name has been aliased ('select foo as bar from...'), use + the alias instead of the column name. + + + + Specifying a numeric offset for the field argument is much quicker + than specifying a fieldname or tablename.fieldname argument. + + + + + + + + &reftitle.returnvalues; + + + + + + &reftitle.seealso; + + Recommended high-performance alternatives: + + fbsql_fetch_row + fbsql_fetch_array + fbsql_fetch_assoc + fbsql_fetch_object + + + + + fbsql_rollback Rollback a transaction to the database - + + &reftitle.description; boolfbsql_rollback resourcelink_identifier - &return.success; + Ends the current transaction by rolling back all statements issued since + last commit. - fbsql_rollback ends the current transaction by - rolling back all statements issued since last commit. This command is only needed if autocommit is set to false. - See also: - fbsql_autocommit and - fbsql_commit + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_autocommit + fbsql_commit + + + + + fbsql_select_db Select a FrontBase database - + + &reftitle.description; boolfbsql_select_db @@ -13,15 +14,7 @@ resourcelink_identifier - fbsql_select_db sets the current active - database on the server that's associated with the specified link - identifier. If no link identifier is specified, the last opened - link is assumed. If no link is open, the function will try to - establish a link as if fbsql_connect was - called, and use it. - - - &return.success; + Sets the current active database on the given link identifier. The client contacts FBExec to obtain the port number to use for @@ -35,19 +28,50 @@ Every subsequent call to fbsql_query will be made on the active database. + + + + + &reftitle.parameters; - if the database is protected with a database password, the user must - call fbsql_database_password before selecting - the database. - - - See also - fbsql_connect, - fbsql_pconnect, - fbsql_database_password, and - fbsql_query. + + + database_name + + + The name of the database to be selected. + + + If the database is protected with a database password, the you must + call fbsql_database_password before selecting the + database. + + + + &fbsql.link-identifier.description; + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_connect + fbsql_pconnect + fbsql_database_password + fbsql_query + + + + + fbsql_set_lob_mode Set the LOB retrieve mode for a FrontBase result set - + + &reftitle.description; boolfbsql_set_lob_mode resourceresult - stringdatabase_name + intlob_mode - Returns: &true; on success, &false; on error. + Sets the mode for retrieving LOB data from the database. - fbsql_set_lob_mode sets the mode for - retrieving LOB data from the database. When BLOB and CLOB data is - stored in FrontBase it can be stored direct or indirect. Direct - stored LOB data will always be fetched no matter the setting of - the lob mode. If the LOB data is less than 512 bytes it will - always be stored directly. - - - - FBSQL_LOB_DIRECT - LOB data is retrieved directly. When data - is fetched from the database with - fbsql_fetch_row, and other fetch - functions, all CLOB and BLOB columns will be returned as - ordinary columns. This is the default value on a new - FrontBase result. - - - - - FBSQL_LOB_HANDLE - LOB data is retrieved as handles to the - data. When data is fetched from the database with - fbsql_fetch_row, and other fetch - functions, LOB data will be returned as a handle to the data - if the data is stored indirect or the data if it is stored - direct. If a handle is returned it will be a 27 byte string - formatted as "@'000000000000000000000000'". - - - - - See also: - fbsql_create_blob, - fbsql_create_clob, - fbsql_read_blob, and - fbsql_read_clob. + When BLOB and CLOB data is retrieved in FrontBase it can be retrieved + direct or indirect. Direct retrieved LOB data will always be fetched no + matter the setting of the lob mode. If the LOB data is less than 512 bytes + it will always be retrieved directly. + + + &reftitle.parameters; + + + &fbsql.result.description; + + lob_mode + + + Can be one of: + + + + FBSQL_LOB_DIRECT - LOB data is retrieved + directly. When data is fetched from the database with + fbsql_fetch_row, and other fetch functions, + all CLOB and BLOB columns will be returned as ordinary columns. + This is the default value on a new FrontBase result. + + + + + FBSQL_LOB_HANDLE - LOB data is retrieved as + handles to the data. When data is fetched from the database with + fbsql_fetch_row, and other fetch functions, + LOB data will be returned as a handle to the data if the data is + stored indirect or the data if it is stored direct. If a handle + is returned it will be a 27 byte string formatted as + @'000000000000000000000000'. + + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_create_blob + fbsql_create_clob + fbsql_read_blob + fbsql_read_clob + + + + + fbsql_set_password Change the password for a given user - + + &reftitle.description; boolfbsql_set_password @@ -14,9 +15,49 @@ stringpassword stringold_password + + Changes the password for the given user. + + - &warn.undocumented.func; + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + user + + + The user name. + + + + + password + + + The new password to be set. + + + + + old_password + + + The old password to be replaced. + + + + + + + + &reftitle.returnvalues; + + &return.success; + diff --git a/reference/fbsql/functions/fbsql-set-transaction.xml b/reference/fbsql/functions/fbsql-set-transaction.xml index 55f2a5ce24..f986f2b8c4 100644 --- a/reference/fbsql/functions/fbsql-set-transaction.xml +++ b/reference/fbsql/functions/fbsql-set-transaction.xml @@ -1,20 +1,51 @@ - + fbsql_set_transaction Set the transaction locking and isolation - + + &reftitle.description; voidfbsql_set_transaction resourcelink_identifier - intLocking - intIsolation + intlocking + intisolation &warn.undocumented.func; + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + locking + + + + + + + isolation + + + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + fbsql_start_db Start a database on local or remote server - + + &reftitle.description; boolfbsql_start_db @@ -14,16 +15,51 @@ stringdatabase_options - &return.success; - - - fbsql_start_db - - - See also: fbsql_db_status and - fbsql_stop_db. + Start a database on local or remote server. + + + &reftitle.parameters; + + + + database_name + + + The database name. + + + + &fbsql.link-identifier.description; + + database_options + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_db_status + fbsql_stop_db + + + + + fbsql_stop_db Stop a database on local or remote server - + + &reftitle.description; boolfbsql_stop_db @@ -13,16 +14,44 @@ resourcelink_identifier - &return.success; - - - fbsql_stop_db - - - See also: fbsql_db_status and - fbsql_start_db. + Stops a database on local or remote server. + + + &reftitle.parameters; + + + + database_name + + + The database name. + + + + &fbsql.link-identifier.description; + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + fbsql_db_status + fbsql_start_db + + + + + fbsql_tablename Get table name of field - + + &reftitle.description; stringfbsql_tablename @@ -13,11 +14,49 @@ inti - fbsql_tablename takes a result pointer - returned by the fbsql_list_tables function - as well as an integer index and returns the name of a table. The - fbsql_num_rows function may be used to - determine the number of tables in the result pointer. + fbsql_tablename gets the name of the current table in + the given result set. + + + The fbsql_num_rows function may be used to determine + the number of tables in the result pointer. + + + + + &reftitle.parameters; + + + + result + + + A result pointer returned by fbsql_list_tables. + + + + + i + + + Integer index for the current table. + + + + + + + + + &reftitle.returnvalues; + + Returns the name of the table, as a string. + + + + + &reftitle.examples; + <function>fbsql_tablename</function> example @@ -37,6 +76,7 @@ while ($i < fbsql_num_rows($result)) { + + fbsql_username - Get or set the host user used with a connection + Get or set the username for the connection - + + &reftitle.description; stringfbsql_username resourcelink_identifier stringusername - &warn.undocumented.func; + + Get or set the username used for the connection. + + + + &reftitle.parameters; + + + &fbsql.link-identifier.description; + + username + + + If provided, this is the new username to set. + + + + + + + + + &reftitle.returnvalues; + + Returns the current username used with the connection, as a string. + + + + + &reftitle.seealso; + + + fbsql_password + fbsql_hostname + + + + + fbsql_warnings Enable or disable FrontBase warnings - + + &reftitle.description; boolfbsql_warnings boolOnOff - Returns &true; if warnings is turned on otherwise &false;. - - - fbsql_warnings enables or disables FrontBase - warnings. + Enables or disables FrontBase warnings. + + + &reftitle.parameters; + + + + OnOff + + + Whether to enable warnings or no. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if warnings is turned on, &false; otherwise. + + + + + + &reftitle.seealso; + + + fbsql_errno + fbsql_error + + + +