v5:activerecord:setdatabaseadapter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
activerecord:setdatabaseadaptor [2015/12/06 02:01] – mnewnham | v5:activerecord:setdatabaseadapter [2022/06/09 18:15] (current) – ↷ Page name changed from v5:activerecord:setdatabaseadaptor to v5:activerecord:setdatabaseadapter dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
~~NOTOC~~ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
+ | == See Also == | ||
+ | [[v5: | ||
== Syntax == | == Syntax == | ||
bool ADODB_Active_Record:: | bool ADODB_Active_Record:: | ||
- | | + | |
+ | | ||
) | ) | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | This allows | + | This links the Active Record class to an ADOdb database connection. The method returns true if it is a valid connection, or false if not. |
+ | |||
+ | The optional '' | ||
------------------------ | ------------------------ | ||
===== Usage ===== | ===== Usage ===== | ||
+ | Example, using single connection | ||
<code php> | <code php> | ||
- | $db = NewADOConnection(...); | + | $db = newAdoConnection(' |
- | $db2 = NewADOConnection(...); | + | $db-> |
+ | $ADOdb_Active_Record:: | ||
+ | </ | ||
+ | Example, multiple connections | ||
+ | <code php> | ||
+ | $db = NewADOConnection(' | ||
+ | $db2 = NewADOConnection(' | ||
- | ADOdb_Active_Record:: | + | $db-> |
+ | $db2-> | ||
- | $activeRecs = $db-> | + | ADOdb_Active_Record:: |
+ | ADOdb_Active_Record:: | ||
- | foreach($activeRecs as $rec) | + | class mPerson extends ADODB_Active_Record |
{ | { | ||
- | $rec2 = new ADOdb_Active_Record('table2',$db2); | + | /* |
- | | + | * Assigns the mysql connection to this class |
- | | + | */ |
- | | + | public |
} | } | ||
+ | |||
+ | class oPerson extends ADODB_Active_Record | ||
+ | { | ||
+ | /* | ||
+ | * Assigns the oracle connection to this class | ||
+ | */ | ||
+ | public $_dbat = ' | ||
+ | } | ||
+ | |||
+ | |||
</ | </ |
v5/activerecord/setdatabaseadapter.1449363672.txt.gz · Last modified: 2017/04/21 11:21 (external edit)