v5:activerecord:getactiverecords
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
activerecord:getactiverecords [2015/12/05 01:19] – [Usage] mnewnham | v5:activerecord:getactiverecords [2016/01/19 05:02] – ↷ Links adapted because of a move operation 66.249.75.209 | ||
---|---|---|---|
Line 2: | Line 2: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
- | == syntax | + | == Syntax |
- | | + | |
string $tableName, | string $tableName, | ||
optional string | optional string | ||
Line 11: | Line 11: | ||
</ | </ | ||
+ | ------------------------------------- | ||
===== Description ===== | ===== Description ===== | ||
- | + | This method retrieves | |
- | GetActiveRecordsClass Performs | + | |
===== Parameters ===== | ===== Parameters ===== | ||
Line 23: | Line 21: | ||
Where clause | Where clause | ||
==== $bindarr ==== | ==== $bindarr ==== | ||
- | For more information on the use of '' | + | For more information on the use of '' |
==== $primaryKeyArray ==== | ==== $primaryKeyArray ==== | ||
Line 36: | Line 34: | ||
$table | $table | ||
$whereOrderBy = "name LIKE ' | $whereOrderBy = "name LIKE ' | ||
- | $activeRecArr = $db->GetActiveRecords($table, $whereOrderBy); | + | $primaryKeys |
+ | $activeRecArr = $db->getActiveRecords($table, $whereOrderBy, | ||
foreach($activeRecArr as $rec) | foreach($activeRecArr as $rec) | ||
{ | { | ||
Line 42: | Line 41: | ||
$rec-> | $rec-> | ||
} | } | ||
+ | </ | ||
+ | |||
+ | And to retrieve all records ordered by specific fields: | ||
+ | <code php> | ||
+ | |||
+ | $whereOrderBy = "1=1 ORDER BY Name"; | ||
+ | $activeRecArr = $db-> | ||
+ | /* | ||
+ | * To use bind variables (assuming ? is the place-holder for your database): | ||
+ | */ | ||
+ | |||
+ | $activeRecArr = $db-> | ||
+ | array(' | ||
+ | |||
+ | /* | ||
+ | Define the primary key field[s] of the table by passing an array of field names: | ||
+ | */ | ||
+ | $activeRecArr = $db-> | ||
+ | array(' | ||
</ | </ | ||
{{tag> | {{tag> |
v5/activerecord/getactiverecords.txt · Last modified: 2018/07/02 14:19 by peterdd