We help IT Professionals succeed at work.
Get Started

PHP dropdown search

booneball asked
Last Modified: 2012-08-14
I am trying to create a search so that when you select a name from a drop down list it takes you to another page and displays the data for that particular user (from the table). The reason for this is because I have about 70 seperate users which I display data for and as you can imagine this is quite a long list.

The select box is as follows:
    <select name="names" id="names" style="width:28%">
    <option value="">Please select...</option>
      $names = mysql_query("SELECT * FROM joomla.jos_users ORDER BY id ASC") or die(mysql_error());
      while($row = mysql_fetch_array($names)) {
            echo "<option value=".$row['id'].">".$row['name']."</option>";

OK so the names are displayed in joomla.jos.users. The table I am getting the data from after selecting a name is it.system. I have to get the data to display by using id eg WHERE names = id

I understand I may also need to use javascipt onclick function.

Watch Question
Project Lead
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE