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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:55:17+00:00 2026-05-27T18:55:17+00:00

I have two tables one tblEmployee and another tblCity . The two tables are

  • 0

I have two tables one tblEmployee and another tblCity.

The two tables are setup like this:

tblEmployee   
-------------
employeeID       
cityID                
name
sex
contactNo

tblCity
-------------
cityID
cityName

I would like to create a form whereby an admin can update an employee’s details. The form has a drop down box which is populated by the cityNames in tblCity.

I am struggling coming up with a query to allow the admin to select one of these cities from the drop down which will update the employee’s cityID to the corresponding city in tblCity.

Many thanks in advance!

  • 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-27T18:55:18+00:00Added an answer on May 27, 2026 at 6:55 pm

    I suspect what you want is to setup the select values like this:

    <option value="cityID">cityName</option> 
    

    The cityID will be submitted, and then you put that value in the tblEmployee.cityID.

    For example:

    <p>
        <select id="sel1">
            <option value="001">Auburn</option>
            <option value="002">Austin</option>
            <option value="003" selected>Dallas</option>
            <option value="004">Houston</option>
        </select>
        <button rel="sel1">Show selected value (with value attribute)</button>
    </p>
    <p>
        <select id="sel2">
            <option>Auburn</option>
            <option>Austin</option>
            <option selected>Dallas</option>
            <option>Houston</option>
        </select>
        <button rel="sel2">Show selected value (no value attribute)</button>
    </p>
    
    $('button').click(function(){
        var $sel = $('#' + $(this).attr('rel')).find('option:selected');
        console.log($sel.val() + ' - ' + $sel.text());
    });
    

    http://jsfiddle.net/5McA9/1/

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

Sidebar

Related Questions

I have two tables one Employee and mailing Subscriptions Employee looks like this: Name
I have two tables, one Company and one Employee: class Company(models.Model): name = models.CharField(max_length=60)
This is for an upcoming project. I have two tables - first one keeps
I have two tables: one contains employees information and another is transactions (sales) information
I have two tables one to many: Table1 ID Name 1 Abe 2 David
I have two MySQL database tables: one containing a list of championships and another
I have two tables: one called Projects, and another called Documents (projects has many
I have two tables one named Person , which contains columns ID and Name
I have two MySQL tables: One for items and another to log purchases. I'm
I have two tables - one called customer_records and another called customer_actions . customer_records

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.