Table of contents
Package: com\tecnick\tcexam\shared
Tags
- file: PostgreSQL driver for TCExam Database Abstraction Layer (DAL). This abstraction layer uses the same SQL syntax of MySQL.
- author: Nicola Asuni
- since: 2004-12-21
Functions
F_db_connect()
File: tce_db_dal_postgresql.php line 37
F_db_connect([mixed $host = 'localhost' ][, mixed $port = '5432' ][, mixed $username = 'postgres' ][, mixed $password = '' ][, mixed $database = 'template1' ]) : PostgreSQL
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.
Parameters
- $host : mixed = ’localhost’: (string) database server host name.
- $port : mixed = ‘5432’: (string) database connection port
- $username : mixed = ‘postgres’: (string) Name of the user that owns the server process.
- $password : mixed = ‘’: (string) Password of the user that owns the server process.
- $database : mixed = ’template1’: (string) Database name.
Return values
PostgreSQL —
link identifier on success, or FALSE on failure.
F_db_close()
File: tce_db_dal_postgresql.php line 69
F_db_close(mixed $link_identifier) : bool
Parameters
- $link_identifier : mixed: (resource) database link identifier.
Return values
bool —
TRUE on success or FALSE on failure
F_db_error()
File: tce_db_dal_postgresql.php line 78
F_db_error([mixed $link_identifier = null ]) : string
Parameters
- $link_identifier : mixed = null
Return values
string —
error message.
F_db_query()
File: tce_db_dal_postgresql.php line 90
F_db_query(mixed $query, mixed $link_identifier) : false
Parameters
- $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
- $link_identifier : mixed: (resource) database link identifier.
Return values
false —
in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
File: tce_db_dal_postgresql.php line 103
F_db_fetch_array(mixed $result) : Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
File: tce_db_dal_postgresql.php line 114
F_db_fetch_assoc(mixed $result) : Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
File: tce_db_dal_postgresql.php line 125
F_db_affected_rows(mixed $link_identifier, mixed $result) : Number
Parameters
- $link_identifier : mixed: (resource) database link identifier [UNUSED].
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of rows.
F_db_num_rows()
File: tce_db_dal_postgresql.php line 135
F_db_num_rows(mixed $result) : Number
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of affected rows.
F_db_insert_id()
File: tce_db_dal_postgresql.php line 147
F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : int
Parameters
- $link_identifier : mixed: (resource) database link identifier.
- $tablename : mixed = ‘’: (string) Table name.
- $fieldname : mixed = ‘’: (string) Field name (column name).
Return values
int —
ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
File: tce_db_dal_postgresql.php line 165
F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQL
Parameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —
query string
F_escape_sql()
File: tce_db_dal_postgresql.php line 178
F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : string
Parameters
- $link_identifier : mixed: (resource) database link identifier.
- $str : mixed: (string) The string that is to be escaped.
- $stripslashes : mixed = true: (boolean) if true strip slashes from string
Tags
- since: 5.0.005 2007-12-05
Return values
string —
Returns the escaped string, or FALSE on error.