-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
92 lines (59 loc) · 2.05 KB
/
search.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!--PABALLO MOLATI 1818416-->
<!DOCTYPE html>
<head>
<meta charset="uft-8">
<meta name="viewpoint" content="width=device-width, initial-scale=1.0">
<title> Sk'haftine food site </title>
<link rel="stylesheet" type="text/css" href="thestyle.css">
</head>
<body>
<div class="header">
<h1>SK'HAFTINI WEB APP</h1>
<ul>
<li><a class="active2" href="#">restaurants </a></li>
<li><a href="home_page.html"> Home </a></li>
<li><a href="food_site.php"><button>BACK </button> </a></li>
</ul>
</div>
<section>
<h1>--SEARCH RESULTS--</h1>
<table class="view">
<tr>
<th>Restaurant_name</th>
<th>Meal_name</th>
<th>Price</th>
</tr
<?php
$search_name=$_POST['search_meal'];
$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "skhafthini";
$aVar = mysqli_connect($dbServername,$dbUsername,$dbPassword,$dbName);
$sql = "SELECT restaurant_name,meal_name,price from meals where meal_name = '$search_name' ";
$result = $aVar->query($sql);
if($result-> num_rows > 0){
while ($row = $result-> fetch_assoc()){
echo "<tr><td>".$row["restaurant_name"]."</td><td>". $row["meal_name"]."</td><td>". $row["price"]."</td></tr>";
}
echo "</table>";
}
else{
echo "<h1>THE MEAL BELOW IS NOT AVAILABLE...</h1>";
echo ""."<br>";
echo "".$search_name;
echo "</table>";
}
$aVar-> close();
?>
<br>
<h1 class="choice">select restaurant</h1>
<br>
<li><h4 class="choice"><a class="Lk" href="vip.php">THE VIP RESTAURANT</a></h4><br></li>
<li><h4 class="choice"><a class="Lk" href="down.php">DOWN TOWN RESTAURANT</a></h4></li>
</section>
<footer>
<p>Copyright©:Sk'haftini Web App 2020 | Designed by Paballo Molati</p>
</footer>
</body>
</html>