-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfavourite.php
More file actions
78 lines (60 loc) · 1.7 KB
/
favourite.php
File metadata and controls
78 lines (60 loc) · 1.7 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
70
71
72
73
74
75
76
77
78
<?php
include('include/connection.php');
include('include/header.php');
?>
<!DOCTYPE html>
<html>
<head>
<title>Liked Item</title>
<style type="text/css">
body{
background-color: skyblue;
padding: 50px 50px;
}
h1{
text-align: center;
color: #fff;
letter-spacing: 6px;
text-shadow: 2px 2px red;
}
</style>
</head>
<body>
<h1> L i k e d P r o d u c t </h1>
<table >
<thead>
<td>Product Image</td>
<td>Product Name</td>
<td>Price</td>
<td>Liked item</td>
<td>Add Cart</td>
</thead>
<?php
$userid = $_SESSION['userid'];
/*$query = "SELECT * FROM ((carts INNER JOIN likes ON carts.userid = likes.userid)
INNER JOIN product ON carts.product_id = product.id) ";*/
$query = "SELECT * FROM `likes` INNER JOIN `product` ON likes.like_pro_id=product.id WHERE user_id ='$userid' ";
$result = mysqli_query($con, $query);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
?>
<tbody>
<tr><img src="<?php echo $row["img"]; ?>"></tr>
<tr><?php echo $row["name"]; ?></tr>
<tr><?php echo $row["price"]; ?></tr>
<tr><?php echo $row["like_status"]; ?></tr>
<tr><?php echo $row["price"]*$row["qty"]; ?></tr>
</tbody>
</table>
<?php
}
}
if(mysqli_num_rows($result) === 0)
{
echo '<h1 class="noitem">"No orders "</h1>';
}
?>
</body>
</html>