I've got Error message:
Fatal error: Uncaught Error: Call to a member function fetchAssoc() on bool in D:\xampp\htdocs\payroll\include\import_data_lembur_events.php:144 Stack trace: #0 D:\xampp\htdocs\payroll\classes\importpage.php(172): eventclass_import_data_lembur->BeforeImport(Object(ImportPage), '') #1 D:\xampp\htdocs\payroll\classes\importpage.php(91): ImportPage->runImportAndSendResultReport() #2 D:\xampp\htdocs\payroll\import_data_lembur_import.php(49): ImportPage->process() #3 {main} thrown in D:\xampp\htdocs\payroll\include\import_data_lembur_events.php on line 144
What wrong with this Query ?
$rs = DB::Query("select count(id) as c from attendance where employee_id = " . $values["employee_id"] . " and date = '" . $values["overtimedate"] . "'");
$data = $rs->fetchAssoc();
$count = $data["c"];
if ($count >=1)
{
$values['company']= $_SESSION["company"];
$values['import_by']= $_SESSION["userid"];
$values["import_date"]=now();
return true;
}
else
{
$message = "Sorry, Your Import Data will not be imported because the attendance Data Still Empty";
exit();
}