v5:reference:adodb_assoc_case
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
v5:reference:adodb_assoc_case [2019/05/08 13:17] – Rewrite and reformat, based also on 'Associative Key Case' page of 'Working With Fields' tutorial dregad | v5:reference:adodb_assoc_case [2019/05/08 13:26] – Example usage: use constants instead of values, simplify code and define $ADODB_FETCH_MODE dregad | ||
---|---|---|---|
Line 20: | Line 20: | ||
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
- | define(' | + | define(' |
- | require "adodb/adodb.inc.php"; | + | require " |
+ | $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; | ||
- | /* | + | // $db Connection |
- | * connection | + | |
- | */ | + | print_r($db-> |
+ | |||
+ | /* Response is: | ||
- | $sql = " | ||
- | $data = $db-> | ||
- | print_r($data); | ||
- | /* | ||
- | * Response is: | ||
| | ||
' | ' | ||
Line 38: | Line 36: | ||
' | ' | ||
) | ) | ||
- | ) | ||
- | |||
*/ | */ | ||
</ | </ | ||
Line 45: | Line 41: | ||
or: | or: | ||
<code php> | <code php> | ||
- | define(' | + | define(' |
- | require "adodb/adodb.inc.php"; | + | require " |
+ | $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; | ||
- | /* | + | // $db Connection |
- | * connection | + | |
- | */ | + | print_r($db-> |
+ | |||
+ | /* Response is: | ||
- | $sql = " | ||
- | $data = $db-> | ||
- | print_r($data); | ||
- | /* | ||
- | * Response is: | ||
| | ||
' | ' | ||
Line 63: | Line 57: | ||
' | ' | ||
) | ) | ||
- | ) | ||
- | |||
*/ | */ | ||
</ | </ | ||
Line 71: | Line 63: | ||
<code php> | <code php> | ||
- | define(' | + | define(' |
- | require "adodb/adodb.inc.php"; | + | require " |
+ | $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; | ||
- | /* | + | // $db Connection |
- | * connection | + | |
- | */ | + | print_r($db-> |
+ | |||
+ | /* Response is: | ||
- | $sql = " | ||
- | $data = $db-> | ||
- | print_r($data); | ||
- | /* | ||
- | * Response is: | ||
| | ||
' | ' | ||
Line 89: | Line 79: | ||
' | ' | ||
) | ) | ||
- | ) | ||
- | |||
*/ | */ | ||
</ | </ |
v5/reference/adodb_assoc_case.txt · Last modified: 2022/06/08 16:14 by dregad