-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsorting.php
More file actions
61 lines (54 loc) · 1.82 KB
/
sorting.php
File metadata and controls
61 lines (54 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
<?php
require("includes/common.php");
?>
<html>
<head> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Show All Farmers Portal | FPFS</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script></head>
<body>
<div class="container-fluid" id="content">
<?php include ("includes/header.php"); ?>
<div class="row decor_bg">
<div class="col-md-6 col-md-offset-3">
<table class="table table-striped">
<?php
$query = "SELECT * FROM product_details WHERE name='Aalu'";
$data = mysqli_query($con,$query);
$total = mysqli_num_rows($data);
//$result = mysqli_fetch_assoc($data);
//echo $total;
if($total!=0)
{
?> <thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Farmer Id</th>
</tr>
</thead>
<tbody>
<?php
$count = $total;
while($count>=0)
{
$result = mysqli_fetch_array($data);
echo "<tr><td>".$result['name']."</td><td>".$result['price']."</td><td>".$result['quantity']."</td><td>".$result['farmer_id']."</td></tr>"."</td><td><a href='cart.php?itemsid=" . "'class='btn btn-primary'>Add to cart</a></td></tr>";
$count--;
}
//echo $total;
}
//else {
//echo "not available";
//}
?>
</table>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>
</body>
</html>