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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:23:30+00:00 2026-06-05T23:23:30+00:00

Forgive me if this is a repeated question but I am having trouble finding

  • 0

Forgive me if this is a repeated question but I am having trouble finding the correct wording for my issue. I have a client that wants me to redo their log page. They want a drop-down box with a list of all the unique cities in their database. I have this part done. The next part is when the user clicks on one of the options, all the logs for that city display. My issue is I cannot figure out how to get the value of select box. I know I can do it with a form submit, but I want to be able to click the box and show it in real time. Here is the code for the drop-down if needed:

Drop-down code:

$select = mysql_query("SELECT DISTINCT location FROM tbl_overnight");

if (!mysql_num_rows($select)) {
    echo "<option value='none'>No Locations...</option>";
} else {
    while ($row = mysql_fetch_assoc($select)) {
    echo "<option value='".$row['location']."'>".$row['location']."</option>";
    }
};

?>

The code for the logs so far is similar to the code above except for the display. I read somewhere that I may have to use AJAX so I can get the real-time value then convert it to a php variable but I’m not sure if that’s the way to go.

If there is another post that is similar to this that I did not see then please link it in a comment below and I will look at it and remove this posting.

  • 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-05T23:23:32+00:00Added an answer on June 5, 2026 at 11:23 pm

    You can’t do this in php you could use ajax and the onChange event in javascipt to do this
    this tutorial may will help you to do what you want

    http://www.w3schools.com/php/php_ajax_database.asp

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

Sidebar

Related Questions

Forgive me if this is a tried question, but I'm having a little difficulty
Forgive me for this seemingly obvious question, but my searches have not revealed the
Forgive me for this noob question, but is there such a setting that sets
Forgive me if this is a particularly stupid question! mysql_query($query) returns a boolean, but
Forgive me if this is a silly question! But to run trinidad as a
Forgive me if this is a duplicate, but it's a minor issue for me
Please forgive this rather basic question, but I'm very new to Java and still
Forgive me if this might be a dumb question but, I'm in an assembly
Forgive me if this post is too naive-sounding. I have a Twitter app that
Forgive me if this is a silly question....but I think back to my Comp.

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.