v5:database:text
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:database:text [2019/12/31 04:23] – make example code fit into the wiki page width peterdd | v5:database:text [2020/01/13 13:17] (current) – fix invalid tag specification dregad | ||
|---|---|---|---|
| Line 66: | Line 66: | ||
| --------------------- | --------------------- | ||
| <code php> | <code php> | ||
| - | $rs = $db-> | + | // 3rd parameter is evaled PHP code, not SQL, so watch the ' |
| - | + | $rs = $db-> | |
| - | /* | + | |
| - | * the 3rd param is searched -- make sure that $COL1 is a legal column name | + | |
| - | */ | + | |
| </ | </ | ||
| Line 85: | Line 82: | ||
| include ' | include ' | ||
| - | $data = | + | $data = array( |
| - | array( | + | |
| 0=> | 0=> | ||
| 1=> | 1=> | ||
| 2=> | 2=> | ||
| - | 3=> | + | 3=> |
| 4=> | 4=> | ||
| 5=> | 5=> | ||
| Line 104: | Line 100: | ||
| $sql = ' | $sql = ' | ||
| - | $result = $db-> | + | // Does not work with PHP 5.3 or later, see workaround below |
| + | $result = $db-> | ||
| while ($r = $result-> | while ($r = $result-> | ||
| Line 110: | Line 107: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Workaround ===== | ||
| + | |||
| + | For PHP 5.3 or later, the following workaround can be used (tested with ADOdb 5.20.15). | ||
| + | |||
| + | Replace the '' | ||
| + | |||
| + | <code php> | ||
| + | $db-> | ||
| + | $result = $db-> | ||
| + | $db-> | ||
| + | </ | ||
| + | |||
| + | {{tag> | ||
v5/database/text.1577762618.txt.gz · Last modified: by peterdd
