I am currently working on a a drop down list which fetch all college names in my college table I was wondering how can I make a another drop down list in which it fetches all departments in the currently selected collage name without using a form (for the page must not reload during the process.
There are two tables involved one is for the departments and other is for college
this is a sample code from the first drop down list.
<tr>
<th class="text-success">College:</th>
<td>
<select name = "AdminUpdateCollageID" class ="bg-info" name>
<option>Please choose a college </option>
<option>
<?php
$sql = mysql_query("SELECT * FROM colleges")
or die("NO table selected" . mysql_error());
while($rw = mysql_fetch_array($sql)){
echo $rw['College_Name'] ; //this displays the values in the dropdown
}
?>
</option></select>
</td>
</tr>
I'l Try to upload the two tables this is the first time I post a question on stackoverflow also I am still a student please bear with me any help will be very appreciated.
Because you are a student, I won't give you a directly answer - I'll give you sources which you will need to read and get the solutions by yourself:
A BONUS TO FIX PHP:
Good luck :)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments