include('header.php'); ?>
$a = stripslashes(mysqli_real_escape_string($con, $_REQUEST['a']));
$b = stripslashes(mysqli_real_escape_string($con, $_REQUEST['b']));
$c = stripslashes(mysqli_real_escape_string($con, $_REQUEST['c']));
$d = stripslashes(mysqli_real_escape_string($con, $_REQUEST['d']));
$paging = 50;
$prev = $_REQUEST['skip']-$paging;
$next = $_REQUEST['skip']+$paging;
if($prev<0) $prev = 0;
$Skip = $_REQUEST['skip'];
if (!isset($next)) $next=$paging;
if (!isset($Skip)) $Skip=0;
if ($_REQUEST['submit'] == "Search") {
$result = mysqli_query($con,"SELECT * FROM ethniccountry WHERE ethnicity LIKE '%$a%' AND Country LIKE '%$b%' AND PrimaryReligion LIKE '%$c%' AND Unengaged LIKE '%$d%' ORDER BY popsum DESC LIMIT $Skip , $paging");
$totalresult = mysqli_query($con,"SELECT * FROM ethniccountry WHERE ethnicity LIKE '%$a%' AND Country LIKE '%$b%' AND PrimaryReligion LIKE '%$c%' AND Unengaged LIKE '%$d%' ");
} else {
$result = mysqli_query($con,"SELECT * FROM ethniccountry ORDER BY popsum DESC LIMIT $Skip , $paging");
$totalresult = mysqli_query($con,"SELECT * FROM ethniccountry");
}
$displaycount = mysqli_num_rows($result);
$count = mysqli_num_rows($totalresult);
$absoluteresult = mysqli_num_rows(mysqli_query($con,"SELECT * FROM ethniccountry"));
?>