Procedural File: tce_db_dal_postgresql.php
Source Location: /shared/code/tce_db_dal_postgresql.php
Page Details:
PostgreSQL driver for TCExam Database Abstraction Layer (DAL).
This abstraction layer uses the same SQL syntax of MySQL.
Tags:
F_db_affected_rows [line 119]
Number F_db_affected_rows(
resource $link_identifier, resource $result)
|
|
Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
Tags:
Parameters
resource |
$link_identifier |
database link identifier [UNUSED]. |
resource |
$result |
result resource to the query result. |
F_db_close [line 78]
bool F_db_close(
resource $link_identifier)
|
|
Closes the non-persistent connection to a database associated with the given connection resource.
Tags:
Parameters
resource |
$link_identifier |
database link identifier. |
F_db_connect [line 65]
PostgreSQL F_db_connect(
[ $host = 'localhost'], [ $port = '5432'], [string $username = 'postgres'], [string $password = ''], [string $database = 'template1'], string $server)
|
|
Open a connection to a PostgreSQL Server and select a database. If a second call is made to this function with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.
Tags:
Parameters
string |
$server |
Database server path. It can also include a port number. e.g. "hostname:port" or a path to a local socket e.g. ":/path/to/socket" for the localhost. |
string |
$username |
Name of the user that owns the server process. |
string |
$password |
Password of the user that owns the server process. |
string |
$database |
Database name. |
|
$host |
|
|
$port |
|
F_db_error [line 86]
Returns the text of the error message from previous database operation
Tags:
F_db_fetch_array [line 109]
Returns F_db_fetch_array(
resource $result)
|
|
Fetch a result row as an associative and numeric array. Note: This function sets NULL fields to PHP NULL value.
Tags:
Parameters
resource |
$result |
result resource to the query result. |
F_db_insert_id [line 139]
int F_db_insert_id(
resource $link_identifier, [string $tablename = ''], [string $fieldname = ''])
|
|
Get the ID generated from the previous INSERT operation
Tags:
Parameters
resource |
$link_identifier |
database link identifier. |
string |
$tablename |
Table name. |
string |
$fieldname |
Field name (column name). |
F_db_num_rows [line 128]
Number F_db_num_rows(
resource $result)
|
|
Get number of rows in result.
Tags:
Parameters
resource |
$result |
result resource to the query result. |
F_db_query [line 97]
FALSE F_db_query(
string $query, resource $link_identifier)
|
|
Sends a query to the currently active database on the server that's associated with the specified link identifier. NOTE: Convert MySQL RAND() function to PostgreSQL RANDOM() on ORDER BY clause of selection queries.
Tags:
Parameters
string |
$query |
The query tosend. The query string should not end with a semicolon. |
resource |
$link_identifier |
database link identifier. |
F_escape_sql [line 154]
string F_escape_sql(
string $str)
|
|
Escape a string for insertion into a SQL text field (avoiding SQL injection).
Tags:
Parameters
string |
$str |
The string that is to be escaped. |
|