Main class definition.
Located in /mysqldb_class.php (line 71)
Constructor of this class.
The constructor takes default values from dbdefs.inc.php. Please see this file for further informations about the setable options.
Returns count of affected rows by last DML operation.
Checks if we are already connected to our database.
If not terminates by calling Print_Error().
Commits current transaction.
Note: Requires transactional tables, else does nothing!
Performs the connection to MySQL.
If anything goes wrong calls Print_Error(). You should set the defaults for your connection by setting user,pass,host and database in dbdefs.inc.php and leave connect() parameters empty. If MYSQLDB_CHARACTERSET define is set a "SET NAMES '<charset>'; is used straight after connecting.
Converts a MySQL default Datestring (YYYY-MM-DD HH:MI:SS) into a strftime() compatible format.
You can use all format tags that strftime() supports, this function simply converts the mysql date string into a timestamp which is then passed to strftime together with your supplied format. The converted datestring is then returned. Please do not use this as default date converter, always use DATE_FORMAT() inside a query whenever possible as this is much faster than using this function! Only if you cannot use the MySQL SQL Date converting functions consider using this function.
Returns the description for a given table.
Array returned has the following fields:
Disconnects from MySQL.
You may optionally pass an external link identifier.
Escapes a given string with the 'mysql_real_escape_string' method.
Always use this function to avoid SQL injections when adding dynamic data to MySQL! This function also handles the settings for magic_quotes_gpc/magic_quotes_sybase, if these settings are enabled this function uses stripslashes() first.
Fetches next row from result handle.
Returns either numeric (MYSQL_NUM) or associative (MYSQL_ASSOC) array for one data row as pointed to by result var.
Frees result returned by QueryResult().
It is a good programming practise to give back what you have taken, so after processing your Multi-Row query with FetchResult() finally call this function to free the allocated memory.
Returns current connection handle.
Returns either the internal connection socket or -1 if no active handle exists. Useful if you want to work with mysql* functions in parallel to this class.
Retrieve last mysql error number.
Retrieve last mysql error description.
Returns microtime in format s.mmmmm.
Used to measure SQL execution time.
Returns amount of time spend on queries executed by this class.
Method to return the current MySQL setting for the character_set variables.
Note that MySQL returns a list of settings, so this method returns all character_set related settings as an associative array.
Method to return the current MySQL setting for the lc_time_names variable.
Private function checks if a given query is not a DML command.
Currently checks for SELECT,SHOW,EXPLAIN,DESCRIBE,OPTIMIZE,ANALYZE,CHECK commands, as these commands all can return a result set.
Returns last used auto_increment id.
Returns the number of rows in the result set.
Use this after a SELECT or SHOW etc. command has been executed. For DML operations like INSERT, UPDATE, DELETE the method AffectedRows() has to be used.
Function performs an insert statement from a given variable list.
The insert statements will be constructed as NEW Insert style, and aligned to the "max_allowed_packet" boundary. This can dramatically improve bulk-inserts compared to fire every INSERT statement one by one. The array passed must be constructed with the keys defined as fieldnames and the values as the corresponding values. Looks like this:
Handles output according to internal debug flag.
Prints out MySQL Error in own <div> container and exits.
Please note that this function does not return as long as you have not set DBOF_RETURN_ALL_ERRORS!
Performs a single row query.
Resflag can be MYSQL_NUM or MYSQL_ASSOC depending on what kind of array you want to be returned. Since v0.38 the value of mysql_num_rows() is stored in self::num_rows if the executed query was either a SELECT or a SHOW statement.
Performs a multi-row query and returns result identifier.
Rollback current transaction.
Note: Requires transactional tables, else does nothing!
Send error email if programmer has defined a valid email address and enabled it with the define MYSQLDB_SENTMAILONERROR.
Allows to set internal socket to external value.
Function allows debugging of SQL Queries.
$state can have these values:
Allows to set the handling of errors.
Sets connection behavour.
If FALSE class uses mysql_connect to connect. If TRUE class uses mysql_pconnect to connect (Persistant connection).
Method to set the character set of the current connection.
You must specify a valid character set name, else the class will report an error. See http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html for a list of supported character sets.
Method to set the time_names setting of the MySQL Server.
Pass it a valid locale string to change the locale setting of MySQL. Note that this is supported only since 5.0.25 of MySQL!
Returns MySQL Server Version.
Opens an own connection if no active one exists.
Documentation generated on Sat, 07 Aug 2010 10:18:23 +0200 by phpDocumentor 1.4.3