<?php
include "connect_to_mysql.php";
$sql = "SELECT * FROM products_listings WHERE category = 'formals' OR categoryoptionone ='formals' OR categoryoptiontwo ='formals'
OR categoryoptionthree ='formals' ORDER BY id DESC";
$result = mysqli_query($conn, $sql);
$outputList = '';
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$id = $row["id"];
$product_name = $row["product_name"];
$category = $row["category"];
$part_number = $row["part_number"];
$price = $row["price"];
$style = $row["style"];
$date_added = date("%b %d, %Y", strtotime($row["date_added"]));
$outputList .=
'<div id="imagewrapper" >
<div style="width:300px;height:343px;float:left; background-image:url(invenimages/'.$id.'.jpg);
background-repeat:no-repeat;
background-size: 100% 100%;" ><a href="product-viewer-all.php?id='.$id.'"><img src="img/transparent-imagecontroler.gif" width="296" height="343" /></a></div>
<div id="imageinfo" >
<div align="left" id="infodetails" >
<font color="black" >Style: '.$style.' </font></div>
<div align="left" id="infodetails" >
<font color="black" >Sales Price:<font color="#FF0000"> $'.$price.'</font></div>
<div align="left" id="infodetails" >
<font color="black" >Part Number: '.$part_number.'</font></div>
</div></div>';
}
} else {
$outputList = "Sorry we have no Gunrack listings at this time";
}
mysqli_close($conn);