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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:58:11+00:00 2026-06-01T14:58:11+00:00

Im a newbie ih php.Im trying to show drop down list values from database

  • 0

Im a newbie ih php.Im trying to show drop down list values from database using this but the data not shown up.There is no error as well. Need some experts advice.

Code

      <?php

include('connectdb.php');     
$sql="SELECT id,name FROM companydetailstbl";
$result=mysql_query($sql);    
$options="";    
while ($row=mysql_fetch_array($result)) {    
    $id=$row["id"];
    //echo $id;
    $thing=$row["name"];
    $options.="<OPTION VALUE=\"$id\">".$thing;
}
?>
        <table width="900" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22%">Company Name </td>
            <td width="3%">:</td>
            <td width="75%"><SELECT NAME="thing">
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT></td>
          </tr>
          <tr>
            <td>Installation Date </td>
            <td>:</td>
            <td><input type="text" name="ins_dt" />
            (ddmmyyyy)</td>
          </tr>
          <tr>
            <td>Expiry Date </td>
            <td>:</td>
            <td><input type="text" name="ex_dt" />
            (ddmmyyyy)</td>
          </tr>
          <tr>
            <td>Status</td>
            <td>:</td>
            <td> </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit" value="Update" />
            <input type="submit" name="Submit2" value="Reset" /></td>
          </tr>
        </table>

Please help. 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-06-01T14:58:12+00:00Added an answer on June 1, 2026 at 2:58 pm

    I don’t know what DTD you are currently using, but according to the HTML 4.0 Specification, you need to close your option tag.

    $options .= '<option value="' . $id . '">' . $thing . '</option>';
    

    Also there,

    <select name="thing">
        <option value="0">Choose</option>
        <?php echo $options; ?>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a bit of a PHP newbie, but I'm trying to assign values (dates
PHP Redirect with Post Data Hi, I am a newbie PHP programmer and trying
Just starting with php and sorry if this is a newbie question but i'm
Hey guys, I'm using smarty and php I am trying to make this function
I'm a bit of a PHP newbie, but I'm trying to put some include
I'm a php newbie (but long time developer in other languages) and I'm trying
As a newbie I am trying to run a PHP file and then an
I'm a PHP newbie working a some scripts to display some news articles from
Hello everyone I am a newbie to php and this is my first ever
I am a newbie to both PHP and Wordpress (but do ok in C#),

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.