-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdanhsach.php
More file actions
67 lines (61 loc) · 1.58 KB
/
Copy pathdanhsach.php
File metadata and controls
67 lines (61 loc) · 1.58 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
require_once('connect.php');
$sql = "SELECT * FROM article";
$result = $conn->query($sql);
?>
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>Danh sách crawl tin tức</h2>
<table>
<tr>
<th>Website</th>
<th>Tiêu đề</th>
<th>Thể loại</th>
<th>Nội dung</th>
</tr>
<?php
if ($result->num_rows > 0) : {
// output data of each row
while ($row = $result->fetch_assoc()) : {
?>
<tr>
<td>
<?= $row['website'] ?>
</td>
<td style="width:20%">
<?= $row['title'] ?>
</td>
<td style="width:10%">
<?= $row['category'] ?>
</td>
<td>
<?= $row['content'] ?>
</td>
</tr>
<?php }
endwhile; ?>
<?php }
endif; ?>
</table>
<?php $conn->close(); ?>
</body>
</html>