Go to the source code of this file.
Functions | |
db_status_report ($phase) | |
db_version () | |
db_connect ($url) | |
_db_query ($query, $debug=0) | |
db_fetch_object ($result) | |
db_fetch_array ($result) | |
db_result ($result) | |
db_error () | |
db_affected_rows () | |
db_query_range ($query) | |
db_query_temporary ($query) | |
db_encode_blob ($data) | |
db_decode_blob ($data) | |
db_escape_string ($text) | |
db_lock_table ($table) | |
db_unlock_tables () | |
db_table_exists ($table) | |
db_column_exists ($table, $column) | |
db_distinct_field ($table, $field, $query) |
Definition in file database.mysqli.inc.
_db_query | ( | $ | query, | |
$ | debug = 0 | |||
) |
Helper function for db_query().
Definition at line 93 of file database.mysqli.inc.
References $name, $result, check_plain(), print, and variable_get().
db_affected_rows | ( | ) |
Determine the number of rows changed by the preceding query.
Definition at line 200 of file database.mysqli.inc.
db_column_exists | ( | $ | table, | |
$ | column | |||
) |
Check if a column exists in the given table.
Definition at line 352 of file database.mysqli.inc.
References db_escape_table(), db_fetch_object(), and db_query().
db_connect | ( | $ | url | ) |
Initialise a database connection.
Note that mysqli does not support persistent connections.
Definition at line 57 of file database.mysqli.inc.
References $url, and _db_error_page().
db_decode_blob | ( | $ | data | ) |
Returns text from a Binary Large OBject value.
$data | Data to decode. |
Definition at line 316 of file database.mysqli.inc.
db_distinct_field | ( | $ | table, | |
$ | field, | |||
$ | query | |||
) |
Wraps the given table.field entry with a DISTINCT(). The wrapper is added to the SELECT list entry of the given query and the resulting query is returned. This function only applies the wrapper if a DISTINCT doesn't already exist in the query.
$table | Table containing the field to set as DISTINCT | |
$field | Field to set as DISTINCT | |
$query | Query to apply the wrapper to |
Definition at line 367 of file database.mysqli.inc.
db_encode_blob | ( | $ | data | ) |
Returns a properly formatted Binary Large Object value.
$data | Data to encode. |
Definition at line 303 of file database.mysqli.inc.
db_error | ( | ) |
Determine whether the previous query caused an error.
Definition at line 192 of file database.mysqli.inc.
db_escape_string | ( | $ | text | ) |
Prepare user input for use in a database query, preventing SQL injection attacks.
Definition at line 323 of file database.mysqli.inc.
db_fetch_array | ( | $ | result | ) |
Fetch one result row from the previous query as an array.
$result | A database query result resource, as returned from db_query(). |
Definition at line 161 of file database.mysqli.inc.
References $result.
db_fetch_object | ( | $ | result | ) |
Fetch one result row from the previous query as an object.
$result | A database query result resource, as returned from db_query(). |
Definition at line 144 of file database.mysqli.inc.
References $result.
db_lock_table | ( | $ | table | ) |
Lock a table.
Definition at line 331 of file database.mysqli.inc.
References db_escape_table(), and db_query().
db_query_range | ( | $ | query | ) |
Runs a limited-range query in the active database.
Use this as a substitute for db_query() when a subset of the query is to be returned. User-supplied arguments to the query should be passed in as separate parameters so that they can be properly escaped to avoid SQL injection attacks.
$query | A string containing an SQL query. | |
... | A variable number of arguments which are substituted into the query using printf() syntax. The query arguments can be enclosed in one array instead. Valid -modifiers are: s, d, f, b (binary data, do not enclose in '') and %%. |
$from | The first result row to return. | |
$count | The maximum number of result rows to return. |
Definition at line 233 of file database.mysqli.inc.
References _db_query(), _db_query_callback(), and db_prefix_tables().
db_query_temporary | ( | $ | query | ) |
Runs a SELECT query and stores its results in a temporary table.
Use this as a substitute for db_query() when the results need to stored in a temporary table. Temporary tables exist for the duration of the page request. User-supplied arguments to the query should be passed in as separate parameters so that they can be properly escaped to avoid SQL injection attacks.
Note that if you need to know how many results were returned, you should do a SELECT COUNT(*) on the temporary table afterwards. db_affected_rows() does not give consistent result across different database types in this case.
$query | A string containing a normal SELECT SQL query. | |
... | A variable number of arguments which are substituted into the query using printf() syntax. The query arguments can be enclosed in one array instead. Valid -modifiers are: s, d, f, b (binary data, do not enclose in '') and %%. |
$table | The name of the temporary table to select into. This name will not be prefixed as there is no risk of collision. |
Definition at line 281 of file database.mysqli.inc.
References _db_query(), _db_query_callback(), and db_prefix_tables().
db_result | ( | $ | result | ) |
Return an individual result field from the previous query.
Only use this function if exactly one field is being selected; otherwise, use db_fetch_object() or db_fetch_array().
$result | A database query result resource, as returned from db_query(). |
Definition at line 179 of file database.mysqli.inc.
References $result.
db_status_report | ( | $ | phase | ) |
Report database status.
Definition at line 23 of file database.mysqli.inc.
References db_version(), get_t(), and l().
db_table_exists | ( | $ | table | ) |
Check if a table exists.
Definition at line 345 of file database.mysqli.inc.
References db_escape_table(), db_fetch_object(), and db_query().
db_unlock_tables | ( | ) |
Unlock all locked tables.
Definition at line 338 of file database.mysqli.inc.
References db_query().
db_version | ( | ) |
Returns the version of the database server currently in use.
Definition at line 46 of file database.mysqli.inc.