D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home2
/
technoi4
/
www
/
Filename :
cat.php
back
Copy
<?php include("config.php"); $data = ''; $cid = $_GET['id']; //$bid = $_GET['id']; $query="SELECT product.*, categary.id as sid, categary.categary_title FROM `product` LEFT JOIN categary ON product.cid=categary.id WHERE product.cid='$cid'"; //$query="SELECT product.*, categary.id as cid, categary.categary_title, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN categary ON product.cid=categary.id LEFT JOIN brand ON product.bid = brand.id WHERE product.cid='$cid' AND product.bid = '$bid'"; //$query="SELECT product.*, categary.id as cid, categary.categary_title, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN categary ON product.cid=categary.id LEFT JOIN brand ON product.bid = brand.id WHERE product.cid='$cid' OR product.bid = '$bid'"; //$query="SELECT product.*, categary.id as cid, categary.categary_title, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN categary ON product.cid=categary.id LEFT JOIN brand ON product.bid = brand.id WHERE product.cid='$cid' AND brand.id = '$bid'"; //$query="SELECT product.*, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN categary ON product.cid=categary.id LEFT JOIN brand ON product.bid = brand.id WHERE product.cid='$cid' OR product.bid = '$bid'"; //$query = "SELECT product.*, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN brand ON product.bid = brand.id WHERE product.bid = '$bid'"; //$query = "SELECT product.*, brand.id as bid, brand.brand_name FROM `product` LEFT JOIN brand ON product.bid = brand.id WHERE product.cid = '$cid'"; $res = mysqli_query($conn,$query) or die("Query to get data failed with error: ".mysqli_error($conn)); while($row = mysqli_fetch_array($res)) { $pid = $row['pid']; $cid = $row['cid']; $bid = $row['bid']; $product_name = $row['product_name']; $image = $row['image']; echo "<div class='col-md-4'>"; echo "<div class='post'>"; echo "<div class='post-media post-image'>"; if($image == ''){ echo '<img loading="lazy" class="img-fluid" style="height: 15rem; width: 19rem; border-radius: 12px 12px 2px 2px;" src="admin/img/product/profile.png">'; }else{ echo "<img loading='lazy' class='img-fluid' style='height: 15rem; width: 19rem; border-radius: 12px 12px 2px 2px;' src='admin/img/product/$image'>"; } echo "</div>"; echo "<div class='post-body'>"; echo "<div class='entry-header'>"; echo "<h2 class='entry-title'>"; echo "<a href='product_detail.php?pid=$pid;' style='font-size: 18px;'>" . $product_name . "</a>"; echo "</h2>"; echo "</div>"; echo "<div class='post-footer'>"; echo "<a href='product_detail.php?pid=$pid;' class='btn btn-primary'>View Details</a>"; echo "</div>"; echo "</div>"; echo "</div>"; echo "</div>"; } ?>