-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoreInfo.php
48 lines (32 loc) · 1017 Bytes
/
moreInfo.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
<?php
include("db_connect.php");
//check if id is set
if(isset($_GET['id'])){
// escape sql chars
$id = mysqli_real_escape_string($connact,$_GET['id']);
//sql command to select all info depend on id
$sql = "SELECT * FROM `omar pizzas` WHERE id=$id";
//GET the result from data base
$result = mysqli_query($connact,$sql);
// fetch the data into array form
$pizza = mysqli_fetch_assoc($result);
mysqli_free_result($result);
mysqli_close($connact);
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include("header.php") ?>
<div class="con-MoreInfo">
<?php if($pizza): ?>
<h2><?php echo $pizza['email']; ?></h2>
<h2><?php echo $pizza['title']; ?></h2>
<h2><?php echo date($pizza['Created_at']); ?></h2>
<h1>Ingredients :</h1>
<h2><?php echo$pizza['ingredients']; ?></h2>
<?php else: ?>
<h1>There is no pizza</h1>
<?php endif ?>
</div>
<?php include("footer.php") ?>
</html>