v5:reference:recordset:getmenu3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
reference:getmenu3 [2015/08/15 01:38] – mnewnham | v5:reference:recordset:getmenu3 [2019/01/01 22:09] – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== getMenu3 ====== | ====== getMenu3 ====== | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
+ | <WRAP info> | ||
+ | This method requires that ADODB_FETCH_MODE be set to ADODB_FETCH_NUM prior to execution of the SQL statement that will provide the recordset. | ||
+ | </ | ||
<WRAP right box> | <WRAP right box> | ||
== Syntax == | == Syntax == | ||
Line 7: | Line 10: | ||
optional mixed $defaultValue=false, | optional mixed $defaultValue=false, | ||
optional bool $blankFirstItem=true, | optional bool $blankFirstItem=true, | ||
- | optional bool $multiple=fale, | + | optional bool $multiple=false, |
optional int $numberOfRows=0, | optional int $numberOfRows=0, | ||
optional string $optionalAttributes='', | optional string $optionalAttributes='', | ||
+ | optional bool $compareSelectedCol0=true | ||
) | ) | ||
| | ||
Line 15: | Line 19: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | The function '' |
- | If a multiple option is not given, the function behaves exactly like '' | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 29: | Line 32: | ||
Set true to create a multi-select box | Set true to create a multi-select box | ||
==== $numberOfRows ==== | ==== $numberOfRows ==== | ||
- | Number of rows to show for multi-select box | + | Number of rows to show for multi-select box. If not a multi-select, |
==== $optionalAttributes ==== | ==== $optionalAttributes ==== | ||
- | Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' | + | Additional attributes to defined for SELECT tag, useful for holding javascript onChange=' |
- | ==== $compareAgainstFirstCol | + | ==== $compareSelectedCol0==== |
- | When we have 2 cols in recordset, we compare the defstr with column | + | When we determine the selected tag, by default |
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
Line 39: | Line 42: | ||
* Connect to DB2 Sample Database | * Connect to DB2 Sample Database | ||
*/ | */ | ||
+ | $db-> | ||
$SQL = " | $SQL = " | ||
$result = $db-> | $result = $db-> | ||
- | $html = $result-> | + | $html = $result-> |
print $html | print $html | ||
Line 49: | Line 53: | ||
<code html> | <code html> | ||
- | <select name=" | + | <select name=" |
< | < | ||
< | < |
v5/reference/recordset/getmenu3.txt · Last modified: 2019/01/01 23:50 by mnewnham