Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Method will not run.

$
0
0

I have the following code:

$new_model = new Model;
$check_valid = $new_model->check_invalid_lineup($team_selection);

echo $check_valid fails to work.

 

I have checked, it is a valid function, with in my Model class, and I have set it to simply return the input parameter. So it looks like this: 

public function check_invalid_lineup($teamid)
    {   
        return $teamid;
}

The variable $team_selection, is gained from another method in the Model class, instantiated  by: 

$new_model    = new Model;
        $user_info_select = $new_model->user_info();
        $team_selection = $user_info_select['team'];

I am stumped as to why I can echo $team_selection with no problem, yet when I insert it as a parameter in the function, check_invalid_lineup() it fails to work! 

Have been puzzling over this for a good few days, shifting code and having no success. Any ideas?


Viewing all articles
Browse latest Browse all 13200

Trending Articles