diff --git a/application/models/monpas/Schooldetails_model.php b/application/models/monpas/Schooldetails_model.php index dd8e893..73143fa 100644 --- a/application/models/monpas/Schooldetails_model.php +++ b/application/models/monpas/Schooldetails_model.php @@ -22,15 +22,9 @@ class Schooldetails_model extends MY_Model{ } function get_details2($schoolid){ - $this->sql="SELECT id, organisatie_id, - if (straat AND straat is not null, straat, '' ) as straat, - if (plaats AND plaats is not null, plaats, '') as plaats, - if (telefoon AND telefoon is not null, telefoon,'') as telefoon, - if (email1 AND email1 is not null, email1, '') as email1, - if (web AND web is not null, web , '') as web, - if (directie AND directie is not null, directie ,'') as directie, - if (ib AND ib is not null, ib, '') as ib, - if (email2 AND email2 is not null, email2, '') as email2 + $this->sql="SELECT id, organisatie_id, COALESCE(straat, '') AS straat, COALESCE(plaats, '') AS plaats, + COALESCE(telefoon, '') AS telefoon, COALESCE(email1, '') AS email1, COALESCE(web, '') AS web, + COALESCE(directie, '') AS directie, COALESCE(ib, '') AS ib, COALESCE(email2, '') AS email2 FROM tb_schooldetails WHERE organisatie_id={$schoolid}"; return $this->get_query_row();