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 4625894
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:20:20+00:00 2026-05-22T03:20:20+00:00

I have a database with names stored. I have my query of the database

  • 0

I have a database with names stored. I have my query of the database working, but lets say I have 5 names that I want to display in a drop down menu. How do I make the default text in the drop down menu display those 5 names?

Basically what I am trying to accomplish is this:

Query my database and store all the names of clients to a variable. Say there are 5 names in the database, I need those 5 names to be stored in a variable. And then for my drop down menu, normally I put the text in like this: < option>Single Floor< /option>

But how do I get those 5 names to appear in the drop down list?

  • 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-22T03:20:21+00:00Added an answer on May 22, 2026 at 3:20 am

    Below is a simple pseudo-script that selects information from a database and outputs a select drop down box. You will need to replace *_fetch_array with whatever DB Extension you are using, and $row['Value'] and $row['DisplayValue'] with the appropriate field names from your DB Schema.

    <select name = 'iAmASelect' id = 'iAmaASelect'>
    <?php
        $DB_Rows = /* fetch data from database */;
        while($row = *_fetch_array($DB_Rows))
            echo("<option value = '" . $row['Value'] . "'>" . $row['DisplayValue'] . "</option>");
    ?>
    </select>
    

    The select will submit $row['Value'] to the form handler, while displaying $row['DisplayValue'] to the user in the drop down list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on sql server monitoring product and i have database query that
Assume that I have a list of employee names from a database (thousands, potentially
Ok, I am working with the publishers database and the query that I need
I have a php form that searches a SQL database. There are say eight
I have a form, that when you select a drop down of articles, the
I have a database that has a table email_eml that stores 3 attributes name_eml,
I have a database with event names and dates. I am trying to create
I have built a local DVD Database using Codeigniter, With film names etc in.
I have 3 tables in my database, for example with such names: TableA, TableB,
We have recently improved the schema of our production database, changing column names and

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.