0
function getAllReferrals(){

    $sql = "(SELECT r.referral_date,c.lastname,c.middlename,c.firstname,c.gender,r.presenting_problem,e.employee_nickname 
        AS nickname FROM CLIENT c INNER JOIN referral1 r ON c.referral_id = r.referral1_id INNER JOIN assign_psychotherapist ap 
        ON ap.a_referral_id = c.referral_id INNER JOIN employee e ON ap.a_psychotherapist_id = e.empid WHERE r.referral_status ='Assigned' 
        OR r.referral_status ='Accepted' ORDER BY referral_date DESC ) UNION ALL (SELECT r.referral_date,c.lastname,c.middlename,c.firstname,
        c.gender,r.presenting_problem,v.volunteer_nickname AS nickname FROM CLIENT c INNER JOIN referral1 r ON c.referral_id = r.referral1_id 
        INNER JOIN assignvolunteer av ON av.Vreferralid = c.referral_id INNER JOIN volunteer v ON av.Vvolunteerid = v.volid 
        WHERE r.referral_status ='Assigned' OR r.referral_status ='Accepted' ORDER BY referral_date DESC )";

    $query = $this->db->query($sql);
    if ($query->num_rows() == 0){
        return $query->result_array();
    }else{
        return NULL;
    }
}

im having foreach trouble with my view because of the array is empty

2
Contributors
3
Replies
10
Views
2 Years
Discussion Span
Last Post by DaveAmour
0

for all i know is that this is not returning an array thats why is empty and i dont know why

Edited by rjgapz

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.