Thanks in advance for any help on this issue!
I want the function get_single to return the $employeeList ARRAY when the IF statement is correct, and a BOOLEAN when the IF is not correct, and therefore FALSE.
Right now I’m only getting a BOOLEN when I run a unit test (using CodeIgniter). What am I doing wrong?
[php]
public function get_single()
{
//--ID from Post
$id = $this->input->post('empid');
settype($id, "integer");
// Query
$query = $this->db->query("SELECT * FROM employees WHERE id= $id;");
$employeeList = $query->result_array();
// If rows results are less than 0 then return false.
if ($query->num_rows($employeeList) > 0) {
return $employeeList;
}
// If value is less than 0
else return false;
}
[/php]