473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using the value of dropdown

Good day sir.
I've been able to populate the dropdown using the value from database but i don't know how to use them to query and display some information.

Here's the code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form method="GET" action="try.php">
  3. School :
  4. <select name="school" class="schools">
  5. <option selected="selected">--Select School--</option>
  6. <?php
  7. include('connection.php');
  8. $sql=mysqli_query($db,"SELECT school FROM subjects GROUP BY school");
  9. while($row=mysqli_fetch_array($sql))
  10. {
  11. $school=$row['school'];
  12. echo '<option value="'.$school.'">'.$school.'</option>';
  13. } ?>
  14. </select>
  15. &nbsp;
  16.  
  17. Course :
  18. <select name="course" class="courses">
  19. <option selected="selected">--Select Course--</option>
  20. <?php
  21. include('connection.php');
  22. $sql=mysqli_query($db,"SELECT course FROM subjects GROUP BY course");
  23. while($row=mysqli_fetch_array($sql))
  24. {
  25. $course=$row['course'];
  26. echo '<option value="'.$course.'">'.$course.'</option>';
  27. } ?>
  28. </select>
  29.  
  30. </form>
  31.  
  32.  
May 6 '15 #1
0 1061

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Lars E. Nes | last post by:
Hi all. I would like to automaticly select a item in a datagridview using the value of column. I do not have the index. Just the value (which is a string). How can this be done? Thanks.
4
by: bissatch | last post by:
Hi, I have a an XML file: <xml... <store> <book> <title>Darkness at Noon</title> <price>12.99</price> <url>http://www.amazon.com/...</url>
5
by: travellinman | last post by:
Hi, I'd like to make an input mask, based on another field's value. For example, if the value of the other field (in another table) is 125, then i want my input mask to start with 125, subsequently...
4
by: Ronald S. Cook | last post by:
Is there a way in ASP/IIS that I can communicate this link: http://www.tournama.com/tournament.aspx?number=29384732 As this instead: http://www.tournama.com/tournament.aspx/29384732 In...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
5
by: mrtr33 | last post by:
I have a class table where I want to access the names of courses and the description of each course. The names of the courses go in a drop down list. Based on the user selection, the description...
2
by: abhishekbrave | last post by:
Hi I have a combo box having the values of year. <select name=year value=2008> <option value=2007>2007</option> <option value=2007>2006</option> <option value=2007>2005</option> </select>& I...
1
by: JM420A | last post by:
Platform: Access 2003 I have a table that has one record, need to pull the EmailAddress field to set as a value for a SendReport Command. I have searched for examples on line as to how to do...
7
by: ieda | last post by:
I want to display information when value in listbox selected. Below is my code:- This code to get value option in listbox <? $query = "select courseTitle from training where startDate > NOW()...
0
by: tariq2030 | last post by:
I have five dropdown lists each with different data sources.the grid view selection should get more refined as i make each selection from ddl1 to ddl5 and the selection should be between two date...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.