Courses.php: better spacing and better variable name (fname -> faculty)
parent
33e454e3da
commit
a8b235052f
14
Courses.php
14
Courses.php
|
@ -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>";
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue