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 08:57] – text driver is only half broken, example for ADOdb 5.20.15 peterdd | v5:database:text [2020/01/13 13:17] (current) – fix invalid tag specification dregad | ||
|---|---|---|---|
| Line 100: | Line 100: | ||
| $sql = ' | $sql = ' | ||
| + | // Does not work with PHP 5.3 or later, see workaround below | ||
| $result = $db-> | $result = $db-> | ||
| Line 107: | Line 108: | ||
| </ | </ | ||
| - | ===== Workaround  | + | ===== Workaround ===== | 
| - | <code php> | + | |
| - | include ' | + | |
| - | $data = array( | + | For PHP 5.3 or later, the following workaround can be used (tested with ADOdb 5.20.15). | 
| - |       0=> | + | |
| - |       1=> | + | |
| - |       2=> | + | |
| - |        | + | |
| - |       4=>array(10005,' | + | |
| - |        | + | |
| - | ); | + | |
| - | $cols = array('EMPNO',' | + | Replace the '' | 
| - | $metaTypes  | + | |
| - | + | ||
| - | $db = ADONewConnection(' | + | |
| - | + | ||
| - | $db->connect($data, $metaTypes, $cols); | + | |
| - | + | ||
| - | $sql = 'select * from table'; | + | |
| + | <code php> | ||
| $db-> | $db-> | ||
| $result = $db-> | $result = $db-> | ||
| $db-> | $db-> | ||
| + | </ | ||
| - | while ($r = $result->fetchRow()) { | + | {{tag>text deprecated}} | 
| - |   print_r($r); | + | |
| - | } | + | |
| - | + | ||
| - | /* | + | |
| - | Array | + | |
| - | ( | + | |
| - | [0] => 10005 | + | |
| - | [1] => 1955-01-21 | + | |
| - | [2] => Kyoichi | + | |
| - | [3] => Maliniak | + | |
| - | [4] => M | + | |
| - | [5] => 1989-09-12 | + | |
| - | ) | + | |
| - | */ | + | |
| - | </ | + | |
v5/database/text.1577779074.txt.gz · Last modified:  by peterdd
                
                