Single_Query($sql1); $CategoryName=$foo->sec_datas['Category']; }else{ $CategoryName="All"; } $link=""; // hyperlink value $sql="select tp.Sno,tc.Category,tp.StockNo,tp.ProductTitle,tp.Description,tp.Curr,tp.Price,date_format(tp.Addeddt,'%d-%b-%Y') as dt from tbl_product tp,tbl_category tc WHERE tp.Category=tc.Sno and tp.publish=1 AND (DATEDIFF(Now(),tp.Availabilitydate) <= 0 or tp.Availabilitydate ='0000-00-00' or tp.Availabilitydate is null)"; if(((!empty($Category))&&($Category<>"View All")) || (!empty($ScreenCat)) && ($action=="go")){ if(!empty($ScreenCat)){ $Category=$ScreenCat; $sql.=" AND tc.Sno=$Category"; $link.="&Category=$Category"; }else{ $sql.=" AND tc.Sno=$Category"; $link.="&Category=$Category"; } } if($action=="go"){ if(!empty($searchval)){ $sql.=" AND (tp.Description LIKE '%$searchval%' OR tp.Price LIKE '%$searchval%' OR tp.StockNo LIKE '$searchval%')"; $link.="&searchval=$searchval"; } $link.="&action=go"; } $foo->Any_Query($sql); //issue the sql query //if($foo->rows>0){ //some records are for display $numrows=$foo->rows; //total number rows if(empty($offset)) { $offset=0; } $startrow=($offset+1); //result display start from if(($offset+$limit)>$numrows){ $endrow=$numrows; }else{ $endrow=($offset+$limit); } ?>
Category :