for ($c=0;$c<count($ERR_CODE);$c++)
{
$i=0;
while ( $i < $num_rows_date)
{
$sql_code = "select COUNT(DISTINCT CELL_SN)ETTL from CE_BTEST where DATE_FORMAT(ACT_DATE,'%Y-%m-%d %T') BETWEEN ('$row_date[$i] 22:00:00' -INTERVAL 1 DAY) and ('$row_date[$i] 22:00:00') and CELL_TYPE like '$CELL_TYPE' and CELL_DENSITY like '$CELL_DENSITY' and SYS_ID like '$SYS_ID' and ERR_CODE like '$ERR_CODE[$c]' ";
for ($c=0;$c<count($ERR_CODE);$c++)
{
$i=0;
while ( $i < $num_rows_date)
{
$sql_code = "select COUNT(DISTINCT CELL_SN)ETTL from CE_BTEST where DATE_FORMAT(ACT_DATE,'%Y-%m-%d %T') BETWEEN ('$row_date[$i] 22:00:00' -INTERVAL 1 DAY) and ('$row_date[$i] 22:00:00') and CELL_TYPE like '$CELL_TYPE' and CELL_DENSITY like '$CELL_DENSITY' and SYS_ID like '$SYS_ID' and ERR_CODE like '$ERR_CODE[$c]' ";
for ($c=0;$c<count($ERR_CODE);$c++)
{
$i=0;
while ( $i < $num_rows_date)
{
$sql_code = "select COUNT(DISTINCT CELL_SN)ETTL from CE_BTEST where DATE_FORMAT(ACT_DATE,'%Y-%m-%d %T') BETWEEN ('$row_date[$i] 22:00:00' -INTERVAL 1 DAY) and ('$row_date[$i] 22:00:00') and CELL_TYPE like '$CELL_TYPE' and CELL_DENSITY like '$CELL_DENSITY' and SYS_ID like '$SYS_ID' and ERR_CODE like '$ERR_CODE[$c]' ";