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 revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
v5:reference:recordset:getmenu2 [2016/01/17 02:47] – ↷ Page moved from v5:reference:getmenu2 to v5:reference:recordset:getmenu2 mnewnhamv5:reference:recordset:getmenu2 [2019/01/01 23:26] mnewnham
Line 1: Line 1:
 ====== getMenu2 ====== ====== getMenu2 ======
 ~~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>
 +
 +<WRAP alert>
 +This method is deprecated and will be removed in a later release
 +</WRAP>
 <WRAP right box> <WRAP right box>
 +== See Also ==
 +[[v5:reference:recordset:getmenu|getMenu()]]\\
 +[[v5:reference:recordset:getmenu3|getMenu3()]]\\
 +
 +
 == Syntax == == Syntax ==
   string getMenu2(   string getMenu2(
Line 15: 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/11/24 00:12 by dregad