v5:database:text
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next 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/04 17:45] – [Usage] add comment before execute() dregad | ||
---|---|---|---|
Line 100: | Line 100: | ||
$sql = ' | $sql = ' | ||
+ | // Does not work with PHP 5.3 or later, see workaround below | ||
$result = $db-> | $result = $db-> | ||
Line 108: | Line 109: | ||
===== Workaround for current ADOdb 5.20.15===== | ===== Workaround for current ADOdb 5.20.15===== | ||
- | <code php> | ||
- | include ' | ||
- | $data = array( | + | Replace the '' |
- | 0=> | + | |
- | 1=> | + | |
- | 2=> | + | |
- | 3=> | + | |
- | 4=> | + | |
- | 5=> | + | |
- | ); | + | |
- | + | ||
- | $cols = array(' | + | |
- | $metaTypes = array(' | + | |
- | + | ||
- | $db = ADONewConnection(' | + | |
- | + | ||
- | $db->connect($data, $metaTypes, $cols); | + | |
- | + | ||
- | $sql = 'select * from table'; | + | |
+ | <code php> | ||
$db-> | $db-> | ||
$result = $db-> | $result = $db-> | ||
$db-> | $db-> | ||
- | |||
- | while ($r = $result-> | ||
- | print_r($r); | ||
- | } | ||
- | |||
- | /* | ||
- | Array | ||
- | ( | ||
- | [0] => 10005 | ||
- | [1] => 1955-01-21 | ||
- | [2] => Kyoichi | ||
- | [3] => Maliniak | ||
- | [4] => M | ||
- | [5] => 1989-09-12 | ||
- | ) | ||
- | */ | ||
</ | </ |
v5/database/text.txt · Last modified: 2020/01/13 13:17 by dregad