-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfoooood.php
More file actions
69 lines (37 loc) · 1.58 KB
/
foooood.php
File metadata and controls
69 lines (37 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
68
69
<?php
include('connect.inc');
//$edesignation = $_POST['edesignation'];
echo('<form action="foooood.php" method="POST">');
$sql_food = "SELECT distinct categoryy FROM fooditems ";
$result = mysql_query($sql_food);
if(!$result) { die('<p> Error Perofrming query .... </p>'); }
if(mysql_num_rows($result)==0) { die('<p>Info does not exist</p>'); }
echo('<select categoryy="select_categoryy" onchange="this.form.submit()">');
echo("<option SELECTED VALUE = \"Select categoryy\">Selecttt Faculty </option>");
while($row = mysql_fetch_object($result))
{
echo("<option value=\"$row->categoryy\">$row->categoryy</option>");
}
echo('</select>');
echo('</form>');
//if (isset($_POST['select_categoryy'])) {
// $select_categoryy = $_POST['select_categoryy'];
//}
//Second Query started
$select_categoryy=$_POST['select_categoryy'];
echo('<form action="food_display.php" method="GET">');
$sql_department = "SELECT distinct Foodname FROM fooditems where categoryy = '$select_categoryy'";
$result1 = mysql_query($sql_department);
if(!$result1) { die('<p> Error Perofrming query .... </p>'); }
if(mysql_num_rows($result1)==0) { die('<p>Info does not exist</p>'); }
echo('<select name="Foodname">');
echo("<option SELECTED> Select your choice </option>");
while($row=mysql_fetch_object($result1))
{
echo("<option value=\"$row->Foodname\">$row->Foodname</option>");
}
echo('</select>');
echo('<input type="hidden" value=0 name="init" />');
echo('<input type="submit" value="Go..." />');
echo('</form>');
?>