-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathn.php
More file actions
34 lines (33 loc) · 865 Bytes
/
Copy pathn.php
File metadata and controls
34 lines (33 loc) · 865 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
32
33
34
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "seminar_wizard";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM college";
$result = $conn->query($sql);
?>
<table>
<tr>
<th>College ID</th>
<th>College Name</th>
<th>District</th>
</tr>
<?php
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$indexno=$row["college_id"];
echo '<tr><td>'.$row["college_id"].'</td><td><a href="song.php?indexno='.$indexno.'">'.$row["college_name"].'</a>'.'</td><td>'.$row["district"].'</td></tr>';
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>