with form submit
<?php
$searchcat = mysqli_real_escape_string($con, $_POST['searchcat']);
$state = mysql_query("select * from product where subcat_name like '%".$searchcat."%' or subcat_name like '%".$searchcat."%' ");
$posts = array();
if(mysql_num_rows($state))
{
while($post2 = mysql_fetch_assoc($state))
{
$productname = $post2['product_name'];
?>
<div class="media blog">
<div class="media-left" style="float: left;">
<a><img src="<? echo $post2['image'];?>" style="width: 250px;"></a>
</div>
<div style="">
<h4 style=" text-transform: uppercase;"><strong><?echo $product_name=$post2["product_name"];?></strong></h4>
<div> <a>Price: <?echo $post2["price"];?></a> </div>
<div style="height: 122px; overflow: hidden;"> <?echo $post2["description"];?></div>
</div>
<a href="product.php?pro=<?echo $productname;?>" class="myButton">read more</a>
</div>
<?
}
}
?>
<?php
$searchcat = mysqli_real_escape_string($con, $_POST['searchcat']);
$state = mysql_query("select * from product where subcat_name like '%".$searchcat."%' or subcat_name like '%".$searchcat."%' ");
$posts = array();
if(mysql_num_rows($state))
{
while($post2 = mysql_fetch_assoc($state))
{
$productname = $post2['product_name'];
?>
<div class="media blog">
<div class="media-left" style="float: left;">
<a><img src="<? echo $post2['image'];?>" style="width: 250px;"></a>
</div>
<div style="">
<h4 style=" text-transform: uppercase;"><strong><?echo $product_name=$post2["product_name"];?></strong></h4>
<div> <a>Price: <?echo $post2["price"];?></a> </div>
<div style="height: 122px; overflow: hidden;"> <?echo $post2["description"];?></div>
</div>
<a href="product.php?pro=<?echo $productname;?>" class="myButton">read more</a>
</div>
<?
}
}
?>
Comments
Post a Comment