com-tecnick-tcexam-shared-mysql

# Procedural File: tce_db_dal_mysql.php Source Location: /shared/code/tce_db_dal_mysql.php ## Page Details: MySQL driver for TCExam Database Abstraction Layer (DAL). This abstraction layer uses the same SQL syntax of MySQL. #### Tags:
author: | Nicola Asuni
copyright: | Copyright &copy; 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
link: | www.tecnick.com
since: | 2003-10-12
license: | GNU Affero General Public License
### F_db_affected_rows [line 125]
`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:
return: | of rows.
#### Parameters
resource | $link_identifier | database link identifier.
resource | $result | result resource to the query result [UNUSED].
[ Top ] ### F_db_close [line 83]
`bool F_db_close( resource $link_identifier)`
Closes the non-persistent connection to a database associated with the given connection resource. #### Tags:
return: | TRUE on success or FALSE on failure
#### Parameters
resource | $link_identifier | database link identifier.
[ Top ] ### F_db_connect [line 65]
`MySQL F_db_connect( [string $host = 'localhost'], [string $port = '3306'], [string $username = 'root'], [string $password = ''], [string $database = ''])`
Open a connection to a MySQL Server and select a database. #### Tags:
return: | link identifier on success, or FALSE on failure.
#### Parameters
string | $host | database server host name.
string | $port | database connection port
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.
[ Top ] ### F_db_error [line 91]
`string F_db_error( )`
Returns the text of the error message from previous database operation #### Tags:
return: | error message.
[ Top ] ### F_db_fetch_array [line 115]
`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:
return: | an array that corresponds to the fetched row, or FALSE if there are no more rows.
#### Parameters
resource | $result | result resource to the query result.
[ Top ] ### F_db_insert_id [line 145]
`int F_db_insert_id( resource $link_identifier, [string $tablename = ''], [string $fieldname = ''])`
Get the ID generated from the previous INSERT operation #### Tags:
return: | ID generated from the last INSERT operation.
#### Parameters
resource | $link_identifier | database link identifier.
string | $tablename | Table name.
string | $fieldname | Field name (column name).
[ Top ] ### F_db_num_rows [line 134]
`Number F_db_num_rows( resource $result)`
Get number of rows in result. #### Tags:
return: | of affected rows.
#### Parameters
resource | $result | result resource to the query result.
[ Top ] ### F_db_query [line 103]
`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 PostgreSQL RANDOM() function to MySQL RAND() on ORDER BY clause of selection queries. #### Tags:
return: | in case of error, TRUE or resource-identifier in case of success.
#### Parameters
string | $query | The query tosend. The query string should not end with a semicolon.
resource | $link_identifier | database link identifier.
[ Top ] ### F_escape_sql [line 169]
`string F_escape_sql( string $str, [boolean $stripslashes = true])`
Escape a string for insertion into a SQL text field (avoiding SQL injection). #### Tags:
return: | Returns the escaped string, or FALSE on error.
since: | 5.0.005 2007-12-05
#### Parameters
string | $str | The string that is to be escaped.
boolean | $stripslashes | if true and magic_quotes_gpc is on, then strip slashes from string
[ Top ] Documentation generated on Thu, 05 Nov 2009 15:58:20 +0100 by phpDocumentor 1.4.3