/shared/code/tce_db_dal_postgresql.php

Description

PostgreSQL driver for TCExam Database Abstraction Layer (DAL).

This abstraction layer uses the same SQL syntax of MySQL.

  • since: 2004-12-21
  • link: www.tecnick.com
  • copyright: Copyright © 2004-2006, Tecnick.com S.r.l. - Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
  • author: Nicola Asuni
Functions
F_db_affected_rows (line 99)

Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.

  • return: of rows.
Number F_db_affected_rows (resource $link_identifier, resource $result)
  • resource $link_identifier: database link identifier [UNUSED].
  • resource $result: result resource to the query result.
F_db_close (line 58)

Closes the non-persistent connection to a database associated with the given connection resource.

  • return: TRUE on success or FALSE on failure
bool F_db_close (resource $link_identifier)
  • resource $link_identifier: database link identifier.
F_db_connect (line 45)

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.

  • return: link identifier on success, or FALSE on failure.
PostgreSQL F_db_connect ([mixed $host = 'localhost'], [mixed $port = '5432'], [string $username = 'postgres'], [string $password = ''], [string $database = 'template1'], string $server)
  • 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.
F_db_error (line 66)

Returns the text of the error message from previous database operation

  • return: error message.
string F_db_error ()
F_db_fetch_array (line 89)

Fetch a result row as an associative and numeric array.

Note: This function sets NULL fields to PHP NULL value.

  • return: an array that corresponds to the fetched row, or FALSE if there are no more rows.
Returns F_db_fetch_array (resource $result)
  • resource $result: result resource to the query result.
F_db_insert_id (line 119)

Get the ID generated from the previous INSERT operation

  • return: ID generated from the last INSERT operation.
int F_db_insert_id (resource $link_identifier, [string $tablename = ''], [string $fieldname = ''])
  • resource $link_identifier: database link identifier.
  • string $tablename: Table name.
  • string $fieldname: Field name (column name).
F_db_num_rows (line 108)

Get number of rows in result.

  • return: of affected rows.
Number F_db_num_rows (resource $result)
  • resource $result: result resource to the query result.
F_db_query (line 77)

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.

  • return: in case of error, TRUE or resource-identifier in case of success.
FALSE F_db_query (string $query, resource $link_identifier)
  • string $query: The query tosend. The query string should not end with a semicolon.
  • resource $link_identifier: database link identifier.

Documentation generated on Fri, 24 Nov 2006 21:16:18 +0100 by phpDocumentor 1.3.0RC3