How to query employee details and relate their performance metrics?
问题 I am fetching the id, first name, and last name of all employees that are approved and not archived. Then I am looping these results and using the ids to query other tables to collect some count data. I tried the below code, but I am not getting the expected output. $queryEmp = " SELECT id, firstname, lastname FROM tbl_employee as e WHERE is_archive=0 and is_approved=1 "; $getQuery= $this->db->query($queryEmp); $result= $getQuery->result(); foreach ($result as $key=> $value) { //echo "<pre>";