ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:recordset:getmenu2

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
v5:reference:recordset:getmenu2 [2019/01/01 22:44]
mnewnham
v5:reference:recordset:getmenu2 [2019/01/01 23:26] (current)
mnewnham
Line 3: Line 3:
 <WRAP info> <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. 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>​
 +
 +<WRAP alert>
 +This method is deprecated and will be removed in a later release
 </​WRAP>​ </​WRAP>​
 <WRAP right box> <WRAP right box>
Line 23: Line 27:
 </​WRAP>​ </​WRAP>​
 ===== Description ===== ===== Description =====
-The function ''​getMenu2()'' ​Generates an HTML SELECT tag string from a recordset, ​and return ​the string. If the recordset has 2 cols, the 1st column ​is compared with the FIRST column. +The function ''​getMenu2()'' ​is shortcut to [[v5:​reference:​recordset:​getmenu|getMenu()]] ​forcing ​the method to use the description (1st column) as the matching field for the selected ​item
-===== Parameters ===== +
-==== $selectName ===== +
-name of SELECT tag +
-==== $defaultValue ==== +
-The value to highlight. Use an array for multiple highlight for listbox. +
-==== $blankFirstLine ==== +
-true to leave the 1st item in list empty +
-==== $multiple ==== +
-Set true to create a multi-select box +
-==== $numberOfRows ==== +
-Number of rows to show for multi-select box +
-==== $optionalAttributes ==== +
-Additional attributes to defined for SELECT tag, useful for holding javascript onChange='​...'​ handlers. +
-==== $compareAgainstFirstCol ==== +
-When we have 2 cols in recordset, we compare the defstr with column 0 (1st col) if this is true.  +
-===== Usage ===== +
-<code php> +
-/* +
-* Connect to DB2 Sample Database +
-*/ +
-$SQL = "​SELECT actdesc,​actno FROM act ORDER BY actno +
-$result = $db->​execute($SQL);​ +
- +
-$html = $result->​getMenu2('​mySelect','​30'​);​ +
- +
-print $html +
- +
-</​code>​ +
- +
-<code html> +
-<select name="​mySelect"​ > +
-<​option></​option>​ +
-<option value='​10'>​MANAGE/​ADVISE</​option>​ +
-<option value='​20'>​ESTIMATE COST</​option>​ +
-<option value='​30'​ selected>​DEFINE SPECS</​option>​ +
-<option value='​40'>​LEAD PROGRAM/​DESIGN</​option>​ +
-<option value='​50'>​WRITE SPECS</​option>​ +
-<option value='​60'>​DESCRIBE LOGIC</​option>​ +
-<option value='​70'>​CODE PROGRAMS</​option>​ +
-<option value='​80'>​TEST PROGRAMS</​option>​ +
-<option value='​90'>​ADM QUERY SYSTEM</​option>​ +
-<option value='​100'>​TEACH CLASSES</​option>​ +
-<option value='​110'>​DEVELOP COURSES</​option>​ +
-<option value='​120'>​PERS AND STAFFING</​option>​ +
-<option value='​130'>​OPER COMPUTER SYS</​option>​ +
-<option value='​140'>​MAINT SOFTWARE SYS</​option>​ +
-<option value='​150'>​ADM OPERATING SYS</​option>​ +
-<option value='​160'>​ADM DATA BASES</​option>​ +
-<option value='​170'>​ADM DATA COMM</​option>​ +
-<option value='​180'>​DOCUMENT</​option>​ +
-</​select>​ +
- +
-</​code>​+
v5/reference/recordset/getmenu2.txt · Last modified: 2019/01/01 23:26 by mnewnham