v5:reference:recordset:getmenu
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:getmenu [2015/08/15 01:06] – mnewnham | v5:reference:recordset:getmenu [2019/11/23 23:30] – [$blankFirstLine] dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== getMenu ====== | ====== getMenu ====== | ||
~~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 getMenu( | string getMenu( | ||
string $selectName, | string $selectName, | ||
- | mixed $defaultValue, | + | |
- | | + | |
- | bool $multiple, | + | |
- | int $numberOfRows, | + | |
- | string $optionalAttributes, | + | |
- | bool $compareAgainstFirstCol | + | |
) | ) | ||
+ | | ||
+ | | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | |
+ | The function '' | ||
+ | |||
+ | If the recordset | ||
+ | If it has 2 columns, the first one is the description and the second | ||
+ | |||
+ | Any extra column beyond the first two will be discarded. | ||
===== Parameters ===== | ===== Parameters ===== | ||
==== $selectName ===== | ==== $selectName ===== | ||
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. a multi-select box is not created, this field has no meaning. |
==== $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 ==== | ==== $compareAgainstFirstCol ==== | ||
- | When we have 2 cols in recordset, we compare | + | If we have 2 columns, by default |
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
Line 38: | Line 58: | ||
$result = $db-> | $result = $db-> | ||
- | $html = $result-> | + | $html = $result-> |
+ | ' | ||
+ | | ||
+ | | ||
+ | | ||
+ | ' | ||
print $html | print $html | ||
- | */ | + | |
</ | </ | ||
<code html> | <code html> | ||
- | <select name=" | + | <select name=" |
< | < | ||
<option value=' | <option value=' | ||
<option value=' | <option value=' | ||
- | <option value=' | + | <option value=' |
<option value=' | <option value=' | ||
<option value=' | <option value=' | ||
Line 68: | Line 93: | ||
</ | </ | ||
- |
v5/reference/recordset/getmenu.txt · Last modified: 2019/11/24 00:16 by dregad