-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopulation.php
More file actions
37 lines (33 loc) · 1.24 KB
/
Copy pathpopulation.php
File metadata and controls
37 lines (33 loc) · 1.24 KB
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
35
36
37
<a href="query.php">Pick another query</a>
<?php
//Query for the population data
$sql = "select name, population, populationurban from countrydata_final;";
//$result = $conn->query($sql);
//echo(mysqli_get_connection_stats($conn));
$result = $conn->query($sql);
if ($result->num_rows > 0) {
//echo "success";
echo '<table style="width: 80%">';
echo '<tr>';
echo '<th style="text-align:left">Country Name</th>';
echo '<th style="text-align:left">Population</th>';
echo '<th style="text-align:left">Urban Population</th>';
echo '</tr>';
while($row = $result->fetch_assoc()) {
//echo '<p>';
echo '<tr>';
//echo 'Country_Name Mobile_phone_subscribers Mortality_under5';
echo '<td>';
echo $row["name"];
echo ' ';
echo '<td>';
echo $row["population"];
echo ' ';
echo '<td>';
echo $row["populationurban"];
echo '<br';
echo '</tr>';
}
echo '</table>';
}
?>