<?php
include '../config.php';

$data = array();

$condX = $_REQUEST['condX'];
$conX = $_REQUEST['conX'];
$tblX = $_REQUEST['tblX'];

if($conX==1)
{    
    $condX="1=1";   
    $q=mysqli_query($conn,"SELECT COUNT(`record`) FROM $tblX");
    $baseX=mysqli_fetch_array($q);   
    $base = $baseX[0];
}
else
{
    $q=mysqli_query($conn,"SELECT COUNT(`record`) FROM $tblX WHERE $condX");
    $baseX=mysqli_fetch_array($q);
    $base = $baseX[0];
}

$data['overall_base'] = $base;

echo json_encode($data);

?>