Databases: Ultimate MySQL wrapper Indrek Altpere (contact me)
This package implements a MySQL database access wrapper.
There are two classes that provide the same functionality to access MySQL databases. One as a regular class and another that provide static functions so it is not necessary to create an object of the class to call it. It can:
- Connect to MySQL database host delayed connections until the first query is run
- Execute queries
- Escape text literal values to use in SQL queries
- Support transactions
- Retrieve query results as a MySQL resource object, regular arrays and associative arrays
- Collapse multiple rows into single level array
- Retrieve the time spent on the last or all queries
- Retrieve the count of rows that were selected or affected by the last or all queries
- Retrieve the identifier of the last inserted row
- Retrieve the count of row found total when SQL_CALC_FOUND_ROWS is used
- Retrieve the names and explanation of tables and fields of a database
- Retrieve the statistics about of all executed queries using the class
- Retrieve large results with iterator class
When used together with and error handler class/function that also logs stacktrace (like my ErrorManager class) you can get full stacktrace for mysql errors since it calls trigger_error on mysql error.