Courses.php: better spacing and better variable name (fname -> faculty)

Bug430-Eden2
Lan Hui 2023-09-08 19:46:51 +08:00
parent 33e454e3da
commit a8b235052f
1 changed files with 7 additions and 9 deletions

View File

@ -610,14 +610,13 @@ include 'Header.php';
<div class='col-md-5'>
List courses by faculty
<select name='faculty' class='form-control'>";
$result = mysqli_query($con,"SELECT DISTINCT(Faculty) as Faculty FROM `courses_table`");
if(mysqli_num_rows($result)==0){
} else {
echo" <option value=''>Search by faculty</option>";
$result = mysqli_query($con, "SELECT DISTINCT(Faculty) AS Faculty FROM courses_table");
if (mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_assoc($result)) {
$fname=$row['Faculty'];
echo " <option value='$fname'> $fname </option>";
}}
$faculty = $row['Faculty'];
echo " <option value='$faculty'> $faculty </option>";
}
}
echo " </select>
</div>
@ -629,7 +628,6 @@ include 'Header.php';
</div>
</div>
</form>
</div></div>";
}