-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalege.php
More file actions
63 lines (55 loc) · 1.82 KB
/
Copy pathalege.php
File metadata and controls
63 lines (55 loc) · 1.82 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
<?php
session_start();
require './init.php';
/*$servername = "localhost";
$username = "root";
$password = "";
$dbname = "combinatii";
$con = new mysqli($servername, $username, $password, $dbname);
$con1 = new mysqli($servername, $username, $password, $dbname);*/
$con = init::getCon();
$query = "SELECT Distinct Denumire FROM `preparat`";
$query1 = "SELECT Distinct Denumire FROM `Ingredient`";
$result = $con->query($query);
$result1 = $con->query($query1);
$result2 = $con->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="alege.css">
</head>
<?php include 'header.php'; ?>
</br></br>
<div>
<form action="trimite.php" method="post" >
<p>Preparat:
<select name="preparat" id="preparat">
<?php
/* while ($row1 = mysqli_fetch_assoc($result)) {
foreach ($row1 as $key => $value) {
?><option><?php echo $value; ?></option><?php
}
}*/
while(($row = $result->fetch()) != false) {
?><option><?php echo $row['Denumire']; ?></option><?php
}
?>
</select>
</p>
<p>Ingredient:
<select name="ingredient" id="ingredient">
<?php
while(($row = $result1->fetch()) != false) {
?><option><?php echo $row['Denumire']; ?></option><?php
}
?>
</select>
</p>
<label>Gramaj:</label>
<input type="text" name="gramaj"></br>
<input type="submit" value="Salveaza">
</form>
</div>
</body>
</html>