System:ADOdb

From Aspen Documentation

Current ADOdb Version: 5.06

Aspen uses the ADOdb library as it's core database abstraction layer. For basic MySQL queries and operations we recommend using the Model class instead. The Model class acts as a wrapper for ADOdb so you may access ADOdb methods at any time during the database operation.

Currently, the model class only supports MySQL. For all other databases that ADOdb, you'll need to query through ADOdb directly. To use other database libraries, modify the database extension configuration with the library of choice.

$config['db_extension'] = "mysql";

ADOdb documentation can be found at http://phplens.com/lens/adodb/docs-adodb.htm.

Aspen comes with a minimal install of ADOdb. By default, only the following files are included:

  • adodb.inc.php
  • adodb-cvslib.inc.php
  • adodb-iterator.inc.php
  • adodb-lib.inc.php
  • adodb-php4.inc.php
  • adodb-time.inc.php
  • drivers/adodb-mysql.inc.php


Within the framework, ADOdb is attached to $this->APP->db.

Basic select statement:

$this->APP->db->Execute('SELECT * FROM tablename');

Return the ID of the latest insert:

$this->APP->db->Insert_ID();