ADOdb
supports a number of leading database applications. Joomla! does not use ADOdb,
but it does emulate some ADOdb functionality in its own database abstraction layer.
We should only use the ADOdb methods if we are porting existing applications
that rely on ADOdb or if we are creating extensions that we also want to work as
standalone applications using ADOdb.
Joomla! uses the JRecordSet class to emulate the ADOdb ADORecordSet class. The
JRecordSet class is not yet complete and does not include all of the ADORecordSet
methods. This example shows the basic usage of JRecordSet; $row is an array:
$db =& JFactory::getDBO();
$rs = $db->Execute('SELECT * FROM #__test');
while ($row = $rs->FetchRow())
{
// process $row
}
The Database
[ 52 ]
For more information about ADOdb, go to http://adodb.sourceforge.net/.
Although ADOdb emulation is being added to Joomla!, it should be
noted that there are currently no plans to integrate ADOdb as the
primary means of accessing the Joomla! database.
JTable
Joomla! provides us with the powerful abstract class JTable; with this we can
perform many basic functions on table records.
Pages:
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82