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'> <div class='col-md-5'>
List courses by faculty 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 {
echo" <option value=''>Search by faculty</option>";
while($row = mysqli_fetch_assoc($result)) { while($row = mysqli_fetch_assoc($result)) {
$fname=$row['Faculty']; $faculty = $row['Faculty'];
echo " <option value='$fname'> $fname </option>"; echo " <option value='$faculty'> $faculty </option>";
}} }
}
echo " </select> echo " </select>
</div> </div>
@ -629,10 +628,9 @@ include 'Header.php';
</div> </div>
</div> </div>
</form> </form>
</div></div>"; </div></div>";
} }
?> ?>