A MySQL database is used for nearly all of poMMo's storage. The datbase holds all information pertaining to subscribers, fields, groups, and configuration options.
Themes, Mailing Templates, temporary files (e.g. CSV import), and compiled templates (SMARTY) are stored as "flat files" and not part of the database.
poMMo accesses the database through its own API contained within the "PommoDB" object. PommoDB is defined in inc/classes/db.php. The calls provide common interactivity with the database, such as handling queries, returning the generated ID of the last query, returning the # of affected rows, and creating arrays from query rows.
All non-static queries (those which take in variables) should be prepared with the SafeSQL class by Monte Ohrt. SafeSQL is provided in inc/lib/safesql/SafeSQL.class.php. See the README file in the safesql directory for more information. Examples of use can be seen throughout most of the internal API calls (inc/classes/*.php, inc/helpers/*.php).
See inc/classes/db.php for database API usage. Better documentation needs to be written. It may, however, be wiser to switch to a well known & supported DB abstraction layer such as ezSQL. This change would alo allow us to use other database engines such as PostgresSQL, Firebird, SQL Lite, MS SQL, and Oracle.
A reference to PommoDB is available in the $pommo global as $pommo->_dbo. The $pommo global is created when bootstrap.php is invoked. NOTE; it is common for internal pages to provide a reference to $pommo->_dbo as plain $dbo via "$dbo =& $pommo->_dbo;"
Explanation of poMMo's database usage and schema can be found in database.schema.html