|
Reference Manual
Variables 变量 | In database drivers that do not support native recordset counting, controls whether to emulate the functionality | | Determines whether to right trim CHAR fields | | If using recordset caching, determines the directory holding the cached data | | If using recordset caching, specifies a class for cached recordset handling | | Sets a default date and time format for the ADOdb date/time library | | Changes the behavior of empty and null field handling when updating or creating records | | Sets the global array type (numeric or associative) for returned recordsets | | Sets the returned value if a valid SQL statement does not match any record when the method getOne() is executed. | | Sets the language for error messages | | Quotes, and optionally controls the casing of field name in constructed SQL statements |
Constants 常量The Database Connection Object 数据库连接对象
Establishing Connections 建立连接 | Create a new connection object | | Establishes a non-persistent connection with a database | | Indicates if a connection has been established | | | | Forces the establishment of a new connection with a database | | Establishes a persistent connection with a database | | Select which database to connect to | | Sets an optional connection parameter | | Closes a database connection |
Working With Cached RecordsetsADOdb supports the ability to work with cached query results, either through storing the results on local disks, or via the use of a Memcached Server. The functions below work the same as their non-caching equivalents, but also check for the availabiltiy of cached results first. This can help reduce database load.
| Configuring local parameters for caching | | Configuring a memcached server connection | | Executes a provided SQL statement and returns a handle to the result, or a cached handle if available | | Executes a provided SQL statement and returns the entire recordset into an array | | Executes a provided SQL statement and returns the entire recordset into an associatitive array with the value of the first column as a key | | Executes a provided SQL statement and returns the first column of each row in the recordset into an array | | Retrieves the first column of the first matching row of an executed SQL statement | | Retrieves the first matching row of an executed SQL statement | | Executes a provided SQL statement and returns a handle to the result, with the ability to supply a starting offset and record count | | Flushes a cached result set |
Executing SQL 执行语句 | Automatically prepares and executes Insert and Update statements based on supplied parameters | | Executes a provided SQL statement and returns a handle to the result | | Executes a provided SQL statement and returns the entire recordset into an array | | Executes a provided SQL statement and returns the entire recordset into an associatitive array with the value of the first column as a key | | Executes a provided SQL statement and returns the first column of each row of he entire recordset into an array | | Returns the median value of a column in a table | | Retrieves the first column of the first matching row of an executed SQL statement | | Retrieves the first matching row of an executed SQL statement | | Provides a simple single record replacement function | | Executes a provided SQL statement and returns a handle to the result, with the ability to supply a starting offset and record count | | Sets the character set for database connections (limited databases) |
Prepared Statements | Sets an input parameter to a stored procedure | | Receives an output parameter from a stored procedure | | Returns a database specific parameter placeholder | | Prepares an SQL statement and returns a handle to use | | Access a stored procedure and returns a handle to the procedure |
Generating Database Independent SQL strings | Quotes a string, without prefixing nor appending quotes | | Returns the largest length of data that can be inserted into a character field | | Returns a database-specific concatenation of strings | | Creates a database-specific SQL UPDATE statement based on supplied parameters | | Creates a database-specific SQL INSERT statement based on supplied parameters | | Replaces a null value with a specified replacement | | Is a pseudonym for the function qstr | | Appropriately quotes strings with ' characters for insertion into the database | | Returns the largest length of data that can be inserted into a text field |
Handling Blobs | Decodes an encoded blob | | Encodes a blob field in preparation for database insertion | | Updates a blob field in a table using a syntax similar to autoexecute | | Updates a blob field in a table directly from a disk file using a syntax similar to autoexecute | | Updates a clob field in a table using a syntax similar to autoexecute |
Paging/Scrolling 分页absolutePage() | gets or sets the current page number in a paged recordset | | gets or sets whether at the first page in a paged recordset | | gets or sets whether at the last page in a paged recordset | cachePageExecute() | Return a requested page from a (possibly) cached recordset | | Returns the page number of the last page in a paged recordset | | Returns the maximum number of records that can be returned when paging | | Returns a requested page from a recordset |
Transaction Scoping 事务 | Begins a granular transaction | | Commits a granular transaction | | Completes a smart transaction | | Forces a smart transaction to fail | | Reports if a granular transaction has failed | | Rollback a smart transaction | | Sets the isolation level of a transaction. | | Starts a smart transaction | transCnt | Returns the nesting level of smart transactions | transOff | Temporarily disables transactions |
Fetching Data
Manipulating Dates & Times | Creates a portable date field, for use in bind statements | | Creates a portable timestamp field, for use in bind statements | | Creates a portable date field, for use in SQL statements | | Creates a portable timestamp field, for use in SQL statements | | Creates a portable date offset field, for use in SQL statements | | Changes the SQL connection to a specified Locale | | Returns a portably-formatted date string from a timestamp database column | | Uses the database connection to create date strings | | Uses the database connection to create date/time strings |
Row Management
Error HandlingerrorMsg() | Returns a database specific error message | ignoreErrors() | Overrides the built-in transaction and error handling status | metaError() | Returns a portable error number based on a database specific error | metaErrorMsg() | Returns a portable error message based on a portable error number. The language of the message may be controlled by $ADODB_LANG |
Query Rewriting | A reference to a function that overrides the execute function |
The Recordset Object
Returns one fieldfields() | Returns a single field in a single row of the current recordset |
PEAR CompatibilityThis series of functions is designed to duplicate the commands and emulate the functionality provided by the now deprecated PEAR DB module. ADOdb also provides an unsupported PEAR Auth connection plugin in the /adodb/pear/auth directory.
| Fetches a recordset into an array | | Returns the current row as an object for convenience and advances the record pointer | | This is a pseudonym for fetchNextObj | | Returns the current row as an object for convenience | | This is a pseudonym for fetchObj | | Reads a row of a result set and advances the recordset pointer | | Is a pseudonym for close() | | Reads a row in associative mode if the recordset fetch mode is numeric | | Returns the number of columns in a row of a returned recordset | | Returns the number of rows in a returned recordset |
Returns all rows
Scrolling | Move to the nth record of a recordset | | Moves the cursor to the next record of the recordset from the current position | | Moves the cursor to the first record of the recordset | | Moves to the last record of a recordset | | absolutePosition() is a pseudonym for currentRow() | | Returns the current row number of a recordset |
Menu generation | Creates a string containing a basic HTML select box | | Creates a string containing a basic HTML select box with alternate comparison criteria to getMenu() | | Creates a string containing a grouped HTML muilti-select box |
Dates | Uses the DBMS to return a timestamp from a date string | | Uses the DBMS to return a timestamp from a date/time string | | Returns a formatted date string for a user supplied timestamp | | Returns a formatted date/time string for a user supplied timestamp |
Recordset Info
Field Info | Returns raw, database specific information about a field | | Returns the the number of fields in a row of a recordset | | |
Recordset Cleanupclose() | Closes both the recordset and database connection |
|
|