|
Procedural File: Database.php
Source Location: Program_Root/Database/Database.php
Classes:
Database
Database is a database abstraction class; a unified means of accessing different relational database systems. It is accompanied by a second class called Query, and relies on driver classes to provide all the database specific functionality.
Page Details:
DB_FETCHMODE_ASSOC [line 27]
DB_FETCHMODE_OBJECT [line 28]
db_create_sequence [line 869]
void db_create_sequence(
mixed $sqn)
|
|
db_drop_sequence [line 873]
void db_drop_sequence(
mixed $sqn)
|
|
db_error [line 839]
Returns the error message, if an error occurred during the last query.
Tags:
db_err_sql [line 851]
Returns the erroneous SQL statement, if an error occurred during the last query.
Tags:
db_execute [line 768]
boolean db_execute(
string 0, mixed 1)
|
|
Similar to db_fetch(), but used for SQL statements that return no results (ie. inserts, updates, deletes, etc.). Returns true or false as to whether the statement executed successfully, or on inserts with an auto-incrementing primary key, returns the last inserted value.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_fetch [line 668]
mixed db_fetch(
string 0, mixed 1)
|
|
Returns the results of a single database query. Returns false if no results are returned, or on error. Returns an object if there is only one result. Returns an array of objects if there are multiple results.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_fetch_array [line 687]
array db_fetch_array(
string 0, mixed 1)
|
|
Same as db_fetch(), except it always returns an array, including an empty array on error or no results (fetch the error with db_error() to differentiate between the two), and an array of one item if there is only one result (whereas db_fetch() would return that as an object).
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_fetch_mode [line 885]
void db_fetch_mode(
[mixed $mode = false])
|
|
db_get_sequence_name [line 881]
void db_get_sequence_name(
mixed $sqn)
|
|
db_lastid [line 827]
Returns the last inserted value from an insert to a table with an auto-incrementing primary key.
Tags:
db_next_id [line 877]
void db_next_id(
mixed $sqn)
|
|
db_pairs [line 737]
array db_pairs(
string 0, mixed 1)
|
|
Similar to db_shift_array(), except it returns an associative array of the first two columns of the query results, where the first column is the key and the second column is the value.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_pear_emu [line 892]
void db_pear_emu(
[mixed $bool = true])
|
|
db_query [line 644]
void db_query(
[mixed $sql = ''], [mixed $cache = 0])
|
|
Alias of the query() method above.
db_quote [line 865]
string db_quote(
string $string)
|
|
Returns the specified string as a value quoted and ready for insertion into an SQL statement. This is called automatically on bind values.
Tags:
Parameters
db_rows [line 815]
Returns the number of rows from the last executed query.
Tags:
db_shift [line 802]
mixed db_shift(
string 0, mixed 1)
|
|
Similar to db_shift(), but only returns the first column of the first result. Returns false on error or if there are no results.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_shift_array [line 710]
array db_shift_array(
string 0, mixed 1)
|
|
Same as db_fetch_array(), except it returns an array of the first value of each object (like db_shift() does for a single result). Please note: Keys are not preserved.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_single [line 785]
object db_single(
string 0, mixed 1)
|
|
Similar to db_fetch(), but only returns a single result as an object, even if there are multiple results. Returns false on error or if there are no results.
Tags:
Parameters
| string |
0 |
|
| mixed |
1 |
bind values |
db_table [line 652]
void db_table(
mixed $table, [mixed $pkey = ''])
|
|
Alias of the table() method above.
|