Welcome Guest, Not a member yet? Register   Sign In
Passing variable to view results in empty variable
#4
Lightbulb 

(03-06-2023, 10:21 PM)HermyC Wrote: Try this..
PHP Code:
public function family()
    {
        $userModel = new UserModel();
        $familyId $this->session->get("familyId");
        $familydata $userModel->where('familyId'$familyId)->findAll();
 
$data = ['familydata' => $familydata];
        return view('family'$data);
//        print_r ($data);
    
and for the view..
PHP Code:
if (empty($familydata))
{
    echo 'Empty';
} else {

    print_r($familydata);

THANK YOU! I understand what I did wrong now. Big props to you!
Reply


Messages In This Thread
RE: Passing variable to view results in empty variable - by Delph1 - 03-06-2023, 11:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB