forked from vedant-0408/group_project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
order1.php
65 lines (54 loc) · 2.01 KB
/
order1.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
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Show Data</title>
<link rel="stylesheet" href="order1.css">
</head>
<body>
<h1>YOUR ORDER IS : </h1>
<div class="order">
<?php
$con = mysqli_connect("localhost", "root", "", "git");
if ($con) {
$nameToFetch = mysqli_real_escape_string($con, $_GET['name']);
$sql = "SELECT * FROM myorder WHERE Name='$nameToFetch'";
$result = mysqli_query($con, $sql);
if ($result) {
if (mysqli_num_rows($result) > 0) {
echo "<table border='1'>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Qty</th>
<th>ItemName</th>
<th>Address</th>
</tr>";
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr>
<td>" . $row['Name'] . "</td>
<td>" . $row['Email'] . "</td>
<td>" . $row['Phone'] . "</td>
<td>" . $row['Qty'] . "</td>
<td>" . $row['ItemName'] . "</td>
<td>" . $row['Address'] . "</td>
</tr>";
}
echo "</table>";
} else {
echo "No records found for the given name.";
}
} else {
echo "Error: " . mysqli_error($con);
}
mysqli_close($con);
} else {
echo "Connection failed: " . mysqli_connect_error();
}
echo "<p>Thank You <br>Visit Again!</p>"
?>
</div>
</body>
</html>