I have this code which i am testing from last couple of hour but unable to understand that why TodayAttendanceCount
is not returning 0.
$sqlCheckLoginEntryCount = "SELECT Count(*) TodayAttendanceCount FROM AttendanceMachineLogin
WHERE Date(RecordAddDateTime) = :RecordAddDateTime
AND TimeTrackId = :TimeTrackId";
$statementEntryCount = $connPDO->prepare($sqlCheckLoginEntryCount);
$queryParams = array(
':TimeTrackId' => $TimeTrackId,
':RecordAddDateTime' => $RecordAddDateTime
);
$statementEntryCount->execute($queryParams);
$queryData = $statementEntryCount->fetch();
echo '\n ';
//var_dump($queryData);
echo "\n Attendance Count". $queryData['TodayAttendanceCount'] ." ;";
I have executed the same query in MySqlWorkbench which is working fine and there is data and it is fine from the database side.