db->query($sql); if (!$qry) { print_r($this->db->error()); echo $this->db->last_query(); exit; } $rows = $qry->result_array(); return $rows[0]; } function populate($dokterID) { $regs = $this->get_regionalID(); $sql = "select T_OrderHeaderID from t_orderheader where T_OrderHeaderM_DoctorID = ? and T_OrderHeaderIsActive = 'Y' and T_OrderHeaderDate + interval 7 day < now() order by T_OrderHeaderID desc limit 0,50"; echo "Date : " . Date() . "\n"; $qry = $this->db->query($sql, [$dokterID]); if (!$qry) { print_r($this->db->error()); echo $this->db->last_query(); exit; } print_r($regs); $rows = $qry->result_array(); print_r($rows); echo "Date : " . Date() . "\n"; } }