Inheritance diagram for db_connection:

Public Member Functions | |
| connected () | |
| return if the connection is up with the base | |
| escapeString ($str) | |
| escape a string so that it is safe to include it in a query | |
| setDebug ($debug_mode) | |
| use debug mode | |
| setNoExecute ($no_execute) | |
| use no execute mode | |
| setError () | |
| retrieve last error from database | |
| execute ($query) | |
| executes an sql query | |
| insertAndGetId ($query) | |
| do an insert and retrieve generated id | |
| select1 ($query) | |
| do a select that yields one row | |
| select ($query) | |
| do a select that yields multiple row | |
| close () | |
| close this connection | |
| tableExists ($table_name) | |
| checks if a table exists | |
| createTableFromFile ($file, $prefix, $charset) | |
| creates a table from an sql file | |
| createTable ($query, $charset) | |
| creates a table | |
| htmlCharsetToMySqlCharset ($charset) | |
| convert a web charset to a MySql charset | |
| mySqlCharsetToHtmlCharset ($charset) | |
| convert a web charset to a MySql charset | |
Public Attributes | |
| $debug_mode | |
| debug flag (will output each query before executing it if true) | |
| $no_execute | |
| won't execute any statements if true | |
| $cumulated_sql_execution_time | |
| cumulated time taken to perform sql queries | |
| $error | |
| last error | |
| $knownDbCharset = array('utf8', 'latin1') | |
| db_connection::close | ( | ) |
| db_connection::connected | ( | ) |
return if the connection is up with the base
Reimplemented in mysql.
| db_connection::createTable | ( | $ | query, | |
| $ | charset | |||
| ) |
creates a table
| query | query that contains the create table sql statement | |
| charset | default charset of MySql table |
Reimplemented in mysql.
| db_connection::createTableFromFile | ( | $ | file, | |
| $ | prefix, | |||
| $ | charset | |||
| ) |
creates a table from an sql file
| file | path to sql file containing create sql statements | |
| prefix | if the sql statement contains {prefix} string, this is the string to use as replacement | |
| charset | charset to use when creating table |
| db_connection::escapeString | ( | $ | str | ) |
escape a string so that it is safe to include it in a query
should be called by user code to escape all user provided variables
| str | the string to escape |
Reimplemented in mysql.
| db_connection::execute | ( | $ | query | ) |
executes an sql query
| query | the query to execute (INSERT, UPDATE, DELETE) |
Reimplemented in mysql.
| db_connection::htmlCharsetToMySqlCharset | ( | $ | charset | ) |
convert a web charset to a MySql charset
| charset | web charset to convert |
| db_connection::insertAndGetId | ( | $ | query | ) |
do an insert and retrieve generated id
| query | the insert query |
Reimplemented in mysql.
| db_connection::mySqlCharsetToHtmlCharset | ( | $ | charset | ) |
convert a web charset to a MySql charset
| charset | web charset to convert |
| db_connection::select | ( | $ | query | ) |
| db_connection::select1 | ( | $ | query | ) |
do a select that yields one row
| query | the select that returns only one row |
Reimplemented in mysql.
| db_connection::setDebug | ( | $ | debug_mode | ) |
use debug mode
| debug_mode | true (debug mode on), or false (debug mode off) |
| db_connection::setError | ( | ) |
| db_connection::setNoExecute | ( | $ | no_execute | ) |
use no execute mode
| no_execute | true (no execute mode on), or false (no execute mode off) |
| db_connection::tableExists | ( | $ | table_name | ) |
| db_connection::$cumulated_sql_execution_time |
cumulated time taken to perform sql queries
| db_connection::$debug_mode |
debug flag (will output each query before executing it if true)
| db_connection::$error |
last error
| db_connection::$no_execute |
won't execute any statements if true
1.4.7