tce__db__dal__postgresql_8php

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
tce_db_dal_postgresql.php File Reference

Namespaces

 com\tecnick\tcexam\shared
 TCExam Shared Area.
 

Functions

 F_db_connect ($host= ‘localhost’, $port= ‘5432’, $username= ‘postgres’, $password= “, $database= ‘template1’)
 
 F_db_close ($link_identifier)
 
 F_db_error ($link_identifier=NULL)
 
 F_db_query ($query, $link_identifier)
 
 F_db_fetch_array ($result)
 
 F_db_fetch_assoc ($result)
 
 F_db_affected_rows ($link_identifier, $result)
 
 F_db_num_rows ($result)
 
 F_db_insert_id ($link_identifier, $tablename= “, $fieldname= “)
 
 F_escape_sql ($link_identifier, $str, $stripslashes=true)
 

Detailed Description

PostgreSQL driver for TCExam Database Abstraction Layer (DAL). This abstraction layer uses the same SQL syntax of MySQL.

Function Documentation

F_db_affected_rows (   $link_identifier,
  $result 
)

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

Parameters
$link_identifier(resource) database link identifier [UNUSED].
$result(resource) result resource to the query result.
Returns
Number of rows.

F_db_close (   $link_identifier)

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

Parameters
$link_identifier(resource) database link identifier.
Returns
bool TRUE on success or FALSE on failure

F_db_connect (   $host = ‘localhost’,
  $port = ‘5432’,
  $username = ‘postgres’,
  $password = ,
  $database = ‘template1’ 
)

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.

Parameters
$host(string) database server host name.
$port(string) database connection port
$username(string) Name of the user that owns the server process.
$password(string) Password of the user that owns the server process.
$database(string) Database name.
Returns
PostgreSQL link identifier on success, or FALSE on failure.

F_db_error (   $link_identifier = NULL)

Returns the text of the error message from previous database operation

Returns
string error message.

F_db_fetch_array (   $result)

Fetch a result row as an associative and numeric array. Note: This function sets NULL fields to PHP NULL value.

Parameters
$result(resource) result resource to the query result.
Returns
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.

F_db_fetch_assoc (   $result)

Fetch a result row as an associative array. Note: This function sets NULL fields to PHP NULL value.

Parameters
$result(resource) result resource to the query result.
Returns
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.

F_db_insert_id (   $link_identifier,
  $tablename = ,
  $fieldname =  
)

Get the ID generated from the previous INSERT operation

Parameters
$link_identifier(resource) database link identifier.
$tablename(string) Table name.
$fieldname(string) Field name (column name).
Returns
int ID generated from the last INSERT operation.

F_db_num_rows (   $result)

Get number of rows in result.

Parameters
$result(resource) result resource to the query result.
Returns
Number of affected rows.

F_db_query (   $query,
  $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.

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

F_escape_sql (   $link_identifier,
  $str,
  $stripslashes = true 
)

Escape a string for insertion into a SQL text field (avoiding SQL injection).

Parameters
$link_identifier(resource) database link identifier.
$str(string) The string that is to be escaped.
$stripslashes(boolean) if true strip slashes from string
Returns
string Returns the escaped string, or FALSE on error.
Since
5.0.005 2007-12-05

 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy