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

$data = array();

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

if($conX==1)
{    
    $condX="1=1";   
}
//echo "SELECT COUNT(`w1.RESPID`) FROM $tblX WHERE w1.RESPID=w2.RESPID AND $condX";

$baseQ = mysqli_query($conn,"SELECT COUNT(w1.RESPID) FROM $tblX WHERE w1.RESPID=w2.RESPID AND $condX");

$baseX=mysqli_fetch_array($baseQ);   
$base = $baseX[0];

array_push($data,$base);

echo json_encode($data);

?>