v5:userguide:learn_abstraction:using_execute
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:userguide:learn_abstraction:using_execute [2016/03/15 01:36] – mnewnham | v5:userguide:learn_abstraction:using_execute [2020/01/02 12:03] (current) – ↷ Links adapted because of a move operation dregad | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <- v5: | + | <- v5: |
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| Line 5: | Line 5: | ||
| The command [[v5: | The command [[v5: | ||
| ===== Reading Data ===== | ===== Reading Data ===== | ||
| - | When used to read the data, the executed command returns a **Query Result**, which can be accessed and used to read the records individually. | + | When used to read the data, the executed command returns a **Query Result** |
| <code php> | <code php> | ||
| $sql = " | $sql = " | ||
| Line 27: | Line 27: | ||
| ' | ' | ||
| ) | ) | ||
| - | * etc, until then end of file | + | * etc, until the end of file |
| */ | */ | ||
| } | } | ||
| Line 43: | Line 43: | ||
| ^Command^Description| | ^Command^Description| | ||
| | [[v5: | | [[v5: | ||
| - | | [[v5: | + | | [[v5: |
| | [[v5: | | [[v5: | ||
| - | | [[v5: | + | | [[v5: |
| ===== Writing Data ===== | ===== Writing Data ===== | ||
| Line 79: | Line 79: | ||
| */ | */ | ||
| $result = $db-> | $result = $db-> | ||
| + | </ | ||
| + | |||
| + | ===== Creating A Recordset Filter ===== | ||
| + | |||
| + | A recordset filter pre-processes all the rows in a recordset after retrieval but before we use it. For example, we want to apply the PHP function // | ||
| + | |||
| + | In order to apply the filter, we must include the extra file **rsfilter.inc.php** | ||
| + | |||
| + | <code php> | ||
| + | |||
| + | include_once ' | ||
| + | include_once ' | ||
| + | |||
| + | /* | ||
| + | * ucwords() every element in the recordset | ||
| + | */ | ||
| + | function doUcwords(& | ||
| + | { | ||
| + | | ||
| + | $arr[$k] = ucwords($v); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | $db = newADOConnection(' | ||
| + | $db-> | ||
| + | |||
| + | $rs = $db-> | ||
| + | $rs = rsFilter($rs,' | ||
| + | </ | ||
| + | |||
| + | The [[v5: | ||
v5/userguide/learn_abstraction/using_execute.1458002219.txt.gz · Last modified: (external edit)
