-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfish.php
57 lines (46 loc) · 1.59 KB
/
fish.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
<?php $page = "Fish"; ?>
<?php require './includes/_dbconnect.php'; ?>
<?php $title = "Fish";?>
<?php require './includes/_header.php'; ?>
<div class="recipeGrid">
<?php
$query = "SELECT * FROM recipes WHERE `filter` = 'b'";
$result = mysqli_query($connection, $query);
// Check there are no errors with our SQL statement
// If no result comes back, die
if (!$result) {
die ("Database query failed.");
}
while ($row = mysqli_fetch_assoc($result)) {
?>
<div class="individualRecipe">
<a href="result.php?id=<?php echo $row['id']; ?>" class="recipeHyperlink">
<img src="./media/recipeImages/<?php echo $row['images']; ?>/main_pic.jpg" alt="<?php echo $row['title']; ?>" id="main"></a>
<h2 class="gridTitle"><?php echo $row['title']; ?></h2>
<p class="gridSide">with <?php echo $row['side']; ?></p>
</div>
<?php
}
// Release Returned Data
mysqli_free_result($result);
// Close Database Connection
mysqli_close($connection);
?>
</div>
<!-- Trigger/Open Modal -->
<button id="myBtn" onclick="helpMe();" title="Help">Help</button>
<!-- Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modalContent">
<div class="modalHeader">
<span class="close">×</span>
<h2 class="modalTitle">Instructions</h2>
</div>
<div class="modalBody">
<p>Select a recipe from the list above. You can also use the search bar to find what you are looking for, or find a recipe by using the filters above.</p>
</div>
</div>
</div>
<script src="javascript.js"></script>
<?php require './includes/_footer.php'; ?>