-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3b.php
More file actions
31 lines (22 loc) · 752 Bytes
/
Copy path3b.php
File metadata and controls
31 lines (22 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$conn=mysqli_connect("db.soic.indiana.edu","i308s18_team30","my+sql=i308s18_team30", "i308s18_team30");
// Check connection
if (!$conn)
{die("Failed to connect to MySQL: " . mysqli_connect_error()); }
else
{ echo "Established Database Connection" ;}
$course = mysqli_real_escape_string($conn,$_POST['course']);
$sql="SELECT CONCAT(FirstName, ' ', LastName) as Name FROM Faculty WHERE $course != CourseID;";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table border='1'><tr><th>Name</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["Name"]."</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
mysqli_close($conn);
?>