Fixed bug196 - Bizarre options on "list courses by faculty" dropdown list #46

Merged
mrlan merged 2 commits from Bug196-Ward into master 2022-06-20 07:03:44 +08:00
2 changed files with 7 additions and 5 deletions

View File

@ -1 +1 @@
deny from all allow from all

View File

@ -689,11 +689,13 @@ List courses by faculty
<select name='faculty' class='form-control'>"; <select name='faculty' class='form-control'>";
$result = mysqli_query($con,"SELECT DISTINCT(Faculty) as Faculty FROM `courses_table`"); $result = mysqli_query($con,"SELECT DISTINCT(Faculty) as Faculty FROM `courses_table`");
if(mysqli_num_rows($result)==0) if(mysqli_num_rows($result)==0){
{} else { while($row = mysqli_fetch_assoc($result)) {
} else {
echo"<option value=''> Search by faculty </option>";
while($row = mysqli_fetch_assoc($result)) {
$fname=$row['Faculty']; $fname=$row['Faculty'];
echo " <option value='$fname'> $fname </option>";
echo "<option value=''> Search by faculty </option> <option value='$fname'> $fname </option>";
}} }}
echo "</select></div></div> echo "</select></div></div>