<?php
include_once("../../lib/konfig.php");
$bj = $_POST['id'];
$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
$query =    "select count(lot) as cari from(
            select concat(shift,date_format(tgl,'%y'),date_format(tgl,'%m'),date_format(tgl,'%d'),kd_mesin) as lot
            from tb_lot) as tb_scan
            where tb_scan.lot in (select left('$bj',8));";
$result = $MySQLi->query($query);
$row = $result->fetch_array();
echo $row['cari'];
