-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathborrow.php
60 lines (51 loc) · 1.45 KB
/
borrow.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
52
53
54
55
56
57
58
59
60
<?php
session_start();
include("connect.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>borrow</title>
</head>
<body>
<?php
$conn2=mysqli_init();
if (!$conn2){die("mysqli_init failed");}
mysqli_ssl_set($conn2,NULL,NULL,"isrgrootx1.pem",NULL,NULL);
if (!mysqli_real_connect($conn2,$servername,$username1,$password1,$dbname1,$port)){die("Connect Error: " . mysqli_connect_error());}
else {echo "Database connected serverless";}
echo '<br>';
$sql = "SELECT NO ,code_id,name,type,status FROM object2 WHERE status = 0"; // Example query
$result = $conn2->query($sql);
if ($result->num_rows > 0) {
// Start the table
echo "<table border='2'>
<tr>
<th>NO</th>
<th>ID</th>
<th>name</th>
<th>type</th>
<th>status</th>
</tr>";
// Output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr>
<td>" . $row["NO"]. "</td>
<td>" . $row["code_id"]. "</td>
<td>" . $row["name"]. "</td>
<td>" . $row['type']. "</td>
<td>" . $row['status']. "</td>
</tr>";
}
echo "</table>";
// End the table
}
else {
echo "0 results";
}
$conn2->close();
?>
</body>
</html>