-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_favorites.php
42 lines (36 loc) · 1.35 KB
/
my_favorites.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
<?php
require "my_products_header.php";
?>
<main>
<div class="small-container">
<h2 class="title"> My favorite products</h2>
<div class="row">
<?php
require_once('mysqli_connect.php');
$sql = "SELECT * FROM Product NATURAL JOIN Favorite WHERE User_ID=$User_ID;";
$result = mysqli_query($dbc,$sql);
$resultCheck = mysqli_num_rows($result);
if($resultCheck > 0){
while($row = mysqli_fetch_assoc($result)){
?>
<div class="col-4">
<img src="ProductImage/<?php echo $row['Product_image']?>" alt="Image of Product" >
<h4><?php echo $row['Product_Name']; ?></h4>
<p>Price: $<?php echo $row['Price_Sell']; ?></p>
<p>Price in market: $<?php echo $row['Price_New']; ?></p>
<p>Suggested selling price: $<?php echo $row['Price_Recommend']; ?></p>
<p>Post date: <?php echo $row['Date_Post']; ?></p>
<p>Description: <?php echo $row['Product_Description']; ?></p>
<button class="col-4-btn">
<?php echo "<a href=my_products_detail.php?Product_ID=".$row['Product_ID']." >More detail</a>" ?>
</button>
<button class="col-4-btn">
<?php echo "<a href=my_favorites_delete.php?Product_ID=".$row['Product_ID']." >Delete</a>" ?>
</button>
</div>
<?php }
}else{
echo "You haven't post any products yet";
}
?>
</main>