-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
51 lines (42 loc) · 1.06 KB
/
index.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>Pilot : Form</title>
<link rel="icon" href="favicon.ico" type="image/gif">
</head>
<body>
<form action="test.php" method="post">
<?php
$con = mysql_connect("localhost","insead","insead2012");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$result = mysql_query("SELECT * FROM data_tables;");
echo "<table border='1'>
<tr>
<th></th>
<th>Indicator Name</th>
<th>Number of countries coverage</th>
<th>Years of coverage</th>
<th>Source</th>
<th>Description</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><input class=\"radio\" type=\"radio\" name=\"table\" value=\"". $row['table_name']."\" /></td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['countries'] . "</td>";
echo "<td>" . $row['year_start'] . " - " . $row['year_end'] . "</td>";
echo "<td>" . $row['source'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<input type="submit" value="Choose">
</form>
</body>
</html>