include("admin/classes/initial.php"); include("admin/classes/config.php"); include("admin/classes/functions.php"); $SearchString = trim($_REQUEST['SearchString']); $CategoryId = trim($_REQUEST['CategoryId']); $rowperpage = 9; $sql = "select a.*,b.Category from communities a join categories b on a.CategoryId=b.CategoryId where a.IsAapproved=1 "; if ($SearchString!="") { $sql .= " and a.Community like '%".mysqli_real_escape_string($con,$EventTitle)."%' "; } if ($CategoryId!="") { $sql .= " and a.CategoryId='".mysqli_real_escape_string($con,$CategoryId)."' "; } $sql .= " order by a.CreatedOn desc limit 0, $rowperpage "; $rsq = mysqli_query($con,$sql); $allcount_query = "select count(*) as allcount from communities a join categories b on a.CategoryId=b.CategoryId where a.IsAapproved=1 "; if ($SearchString!="") { $sql .= " and a.Community like '%".mysqli_real_escape_string($con,$EventTitle)."%' "; } if ($CategoryId!="") { $sql .= " and a.CategoryId='".mysqli_real_escape_string($con,$CategoryId)."' "; } $allcount_result = mysqli_query($con,$allcount_query); $allcount_fetch = mysqli_fetch_array($allcount_result); $allcount = $allcount_fetch['allcount']; ?>