Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Web Development (https://www.askmehelpdesk.com/forumdisplay.php?f=467)
-   -   MySQL query has to display in dropdown button in jsp (https://www.askmehelpdesk.com/showthread.php?t=476290)

  • Jun 4, 2010, 12:19 AM
    Amit_Patil
    MySQL query has to display in dropdown button in jsp
    MySQL query result has to display in drop-down button in jsp.
  • Aug 3, 2010, 04:20 PM
    dandemeyere
    Well I'm not sure about the actual JSP code used to do this. But when you retrieve your MySQL result and store it in an array, iterate through the array and at every instance, create a new drop-down item.
    Pseduocode:
    Code:

    <select>
    <!-- JSP code starts here -->
    arrReturn = query(result);
    for(int i=0; i < arrReturn.length(); i++) {
    echo '<option value="' . i . '">' . arrReturn[i] . '</option>';
    }
    <!-- End JSP code -->
    </select>


  • All times are GMT -7. The time now is 10:55 AM.