forked from ramchandra-guthula/devops-training
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_data.html
More file actions
42 lines (37 loc) · 1.14 KB
/
get_data.html
File metadata and controls
42 lines (37 loc) · 1.14 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
38
39
40
41
42
<html>
<body>
<?php
$servername = "devops-app.cirfjiv0tncx.ap-south-1.rds.amazonaws.com";
$username = "admin";
$password = "Admin123";
$database = "devops";
$mysqli = new mysqli($servername, $username, $password, $database);
$query = "SELECT * FROM devops";
echo '<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td> <font face="Arial">Value1</font> </td>
<td> <font face="Arial">Value2</font> </td>
<td> <font face="Arial">Value3</font> </td>
<td> <font face="Arial">Value4</font> </td>
<td> <font face="Arial">Value5</font> </td>
</tr>';
if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
$id = $row["col1"];
$firstname = $row["col2"];
$lastname = $row["col3"];
$address = $row["col4"];
$city = $row["col5"];
echo '<tr>
<td>'.$id.'</td>
<td>'.$firstname.'</td>
<td>'.$lastname.'</td>
<td>'.$address.'</td>
<td>'.$city.'</td>
</tr>';
}
$result->free();
}
?>
</body>
</html>