I want to make the for loop to return a single value (TRUE/FALSE). But the code returns multiple value. Like TRUETRUETRUE. I understand the code but didn’t have any idea to do it.
public function user_activation_check(){
for($i=1;$i<5;$i++){
$query = $this->db->query("SELECT group_info.member".$i." FROM `group_info` INNER JOIN `user_student` ON group_info.member$i=user_student.email WHERE user_student.email=group_info.member$i");
if($query->num_rows()==1){
//return TRUE;
echo"true";
}else {
//return FALSE;
echo"false";
}
}
}
Help please.
UPDATE:
public function member_activation(){
if($this->model_users->user_activation_check()){
$this->load->view('v_confirm_group');
}else echo "Some members didn't activate their account.";
}
I think this is what you want: