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 | ||
v5:reference:recordset:getmenu3 [2016/01/17 02:50] – ↷ Page moved from v5:reference:getmenu3 to v5:reference:recordset:getmenu3 mnewnham | v5:reference:recordset:getmenu3 [2019/01/01 23:42] – 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> | ||
+ | == See Also == | ||
+ | [[v5: | ||
+ | [[v5: | ||
+ | |||
== Syntax == | == Syntax == | ||
string getMenu3( | string getMenu3( | ||
Line 7: | Line 14: | ||
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='' |
) | ) | ||
| | ||
Line 15: | Line 22: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | The function '' |
- | If a multiple option is not given, the function behaves exactly like '' | + | In order for the optgroup to work correctly, the SQL statement used must be ORDERED by some order that begins with the 3rd column in the SELECT. |
===== Parameters ===== | ===== Parameters ===== | ||
Line 23: | Line 30: | ||
name of SELECT tag | name of SELECT tag | ||
==== $defaultValue ==== | ==== $defaultValue ==== | ||
- | The value to highlight. Use an array for multiple | + | The value to highlight. Use either a string for a single value to match, or a numeric |
==== $blankFirstLine ==== | ==== $blankFirstLine ==== | ||
- | true to leave the 1st item in list empty | + | This parameter has the following available options: |
+ | |||
+ | * true (default) - creates an empty ''< | ||
+ | * false - does not creates an empty ''< | ||
+ | * string value - creates an ''< | ||
+ | * string value format '' | ||
==== $multiple ==== | ==== $multiple ==== | ||
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 ==== | + | |
- | When we have 2 cols in recordset, we compare | + | |
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
Line 39: | Line 50: | ||
* Connect to DB2 Sample Database | * Connect to DB2 Sample Database | ||
*/ | */ | ||
+ | $db-> | ||
$SQL = " | $SQL = " | ||
$result = $db-> | $result = $db-> | ||
- | $html = $result-> | + | $html = $result-> |
+ | array(' | ||
+ | | ||
+ | | ||
+ | | ||
+ | ' | ||
print $html | print $html | ||
Line 49: | Line 66: | ||
<code html> | <code html> | ||
- | <select name=" | + | <select name=" |
< | < | ||
< | < | ||
Line 55: | Line 72: | ||
<option value=' | <option value=' | ||
<option selected=' | <option selected=' | ||
- | <option value=' | + | < |
- | <option value=' | + | < |
<option value=' | <option value=' | ||
</ | </ |
v5/reference/recordset/getmenu3.txt · Last modified: 2019/01/01 23:50 by mnewnham