ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:recordset:getmenu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
v5:reference:recordset:getmenu [2019/01/01 23:14] mnewnhamv5:reference:recordset:getmenu [2019/01/01 23:49] mnewnham
Line 12: Line 12:
       optional string $selectName='',       optional string $selectName='',
       optional mixed $defaultValue=false,       optional mixed $defaultValue=false,
-      optional bool $blankFirstItem=true,+      optional mixed $blankFirstItem=true,
       optional bool $multiple=false,       optional bool $multiple=false,
       optional int $numberOfRows=0,       optional int $numberOfRows=0,
Line 25: Line 25:
 If the returned recordset has a single column, the option values and descriptions are the same. If the returned recordset has a single column, the option values and descriptions are the same.
 If the returned recordset has 2 cols, the 1st column is the description and the 2nd column is the value. By default, the 2nd column is matched against the defaut, if provided.  If the returned recordset has 2 cols, the 1st column is the description and the 2nd column is the value. By default, the 2nd column is matched against the defaut, if provided. 
 +If the recordset returns more than 2 columns, the 3rd and greater columns are discarded.
 ===== Parameters ===== ===== Parameters =====
 ==== $selectName ===== ==== $selectName =====
Line 31: Line 32:
 The value to highlight. Use either a string for a single value to match, or a numeric array if a multiselect box is going to be built and there are multiple matching defaults.  The value to highlight. Use either a string for a single value to match, or a numeric array if a multiselect box is going to be built and there are multiple matching defaults. 
 ==== $blankFirstLine ==== ==== $blankFirstLine ====
-true to leave the 1st item in list empty+This parameter has the following available options: 
 + 
 +  * true (default) - creates an empty ''<option></option>'' tag 
 +  * false - does not creates an empty ''<option></option>'' tag 
 +  * string value - creates an ''<option value=``>STRING</option>'' tag 
 +  * string value format ''value:description'' - creates an ''<option value='value'>description</option>'' tag 
 ==== $multiple ==== ==== $multiple ====
 Set true to create a multi-select box Set true to create a multi-select box
Line 39: Line 46:
 Additional attributes to defined for SELECT tag, useful for holding javascript onChange='...' handlers or class information. Note that by default, the select box is generated without an id, so this should be included here. Additional attributes to defined for SELECT tag, useful for holding javascript onChange='...' handlers or class information. Note that by default, the select box is generated without an id, so this should be included here.
 ==== $compareAgainstFirstCol ==== ==== $compareAgainstFirstCol ====
-If we have 2 columns, by default the default value is located by matching against the 2nd column (the value). By setting this flag to false, we can locate the selected option by matching against the 1st column (the description). +If we have 2 columns, by default the default value is located by matching against the 2nd column (the value). By setting this flag to false, we can locate the selected option by matching against the 1st column (the description). This works even if the list of selected items is an array
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
v5/reference/recordset/getmenu.txt · Last modified: 2019/11/24 00:16 by dregad