Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:09:13+00:00 2026-05-17T15:09:13+00:00

I am kinda new to this, but I am trying to fill an array

  • 0

I am kinda new to this, but I am trying to fill an array from a sql statement that pulls several permit numbers from a table.

So in the table every person can have multiple permits, I need to store all the permit numbers and display them in a drop down box via javascript. I get the information from the array but the information is displayed in a repeating fashion where the first item is in the drop down box, then it re-creates the drop down box with the second item, and so on until all the array information is displayed.
I need this pattern not to repeat, but the items in the array fill ONE drop down box on the page.

Here is the code:

     ResultSet rsTagCheck = stmt.executeQuery("SELECT PARKING.XKRPRMT.XKRPRMT_PIDM, PARKING.XKRPRMT.XKRPRMT_STATUS, PARKING.XKRPRMT.XKRPRMT_EXPIRE_YR, PARKING.XKRPRMT.XKRPRMT_TAG FROM PARKING.XKRPRMT WHERE XKRPRMT_PIDM ='" + BannerID + "'");
    while (rsTagCheck.next()){

           String TagNum = rsTagCheck.getString("XKRPRMT_TAG");
           String[] tag = new String[101];
           for (int i = 0; i < tag.length; i++)
               tag[i] = TagNum;
%>
       <table style="border:transparent" style="width:100%">
            <tr>
             <td style ="width: 300px;">
             <select style="width:150px;"tabindex="5" name="Tag">
                 <option></option><option>T - Temporary</option>
                 <option><%=tag[0]%></option>
                 <option><%=tag[1]%></option>
                 <option><%=tag[2]%></option>
                 <option><%=tag[3]%></option>
                 <option><%=tag[4]%></option>
                 <option><%=tag[5]%></option>
             </select>
             </td>

       </table>

       <div style="width:200px;"><input type="submit"value="Add Tag">
       </div>
       <button  onclick="window.location='startup.jsp'">Home</button>

        <%}
        rsTagCheck.close();
        stmt.close();
        conn.close();
      %>

I NEED HELP

Any help would be greatly appreciated. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:09:14+00:00Added an answer on May 17, 2026 at 3:09 pm

    You need to move the Control Creation outside your While loop. The way you have it a new control is created for each value.

           <table style="border:transparent" style="width:100%">
                <tr>
                 <td style ="width: 300px;">
                 <select style="width:150px;"tabindex="5" name="Tag">
    
    <%    while (rsTagCheck.next()){
    ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am kinda new to all this but I am trying to make myself
I'm kinda new to Flex. I have trying to send Hash from Ruby on
Im trying to send a array to my method with $.post() but Im kinda
I'm kinda new to android development, but i'm trying to make a xml parser.
I'm kinda new to this so I'll just get to it. I'm trying to
This is a kind of a newb question but I'm really new to programming
I am kinda new to this Regex thing. When analyzing some code I frequently
first of all i'm kinda new to C# I'm trying to do something like
I know this isn't a direct programming question, but's it's kinda relevant as I'm
I have been trying to work out the bug on this but can't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.