-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
54 lines (45 loc) · 1.59 KB
/
home.php
File metadata and controls
54 lines (45 loc) · 1.59 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
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
</head>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery1.js"></script>
<body>
<div align="center"><h2>Lost Items</h2></div>
<div class="container">
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "myDB";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT * FROM LostItems";
$results = $conn->query($sql);
if($results->num_rows > 0) {
while($row = $results->fetch_assoc()) {
echo "<div class='container'>
<div class='col-md-4'>
<img src='uploads/$row[img_name]' height='200px' width='200px' />
<h4>$row[item_name]</h4>
</div>
</div>";
}
}
$conn->close();
// $myfile = fopen("imageNames.txt", 'r');
// $items = fopen("itemNames.txt", 'r');
// while(!feof($myfile) && !feof($items)){
// $fname = fgets($myfile);
// $iname = fgets($items);
// echo "<div class='col-md-3' style='margin-top:50px'>
// <img id='imgs' width='200px' height='200px' src='uploads/$fname' />
// <h4>$iname</h4>
// </div>";
// }
// fclose($myfile);
?>
</div>
</body>
</html>