Zugzwangle Posted September 20, 2013 Share Posted September 20, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/282324-method-will-not-run/ Share on other sites More sharing options...
requinix Posted September 20, 2013 Share Posted September 20, 2013 You've posted a few snippets but nothing that shows them all together. What's the whole reproduce script? It sounds like you're describing $new_model = new Model; $user_info_select = $new_model->user_info(); $team_selection = $user_info_select['team']; echo $team_selection; // something $check_valid = $new_model->check_invalid_lineup($team_selection); echo $check_valid; // nothing Quote Link to comment https://forums.phpfreaks.com/topic/282324-method-will-not-run/#findComment-1450456 Share on other sites More sharing options...
Zugzwangle Posted September 20, 2013 Author Share Posted September 20, 2013 (edited) Please excuse me requinix. That is correct!! $check_valid produces nothing, even though $team_selection echo's the team, and check_invalid_lineup() is a valid callable function... Edited September 20, 2013 by Zugzwangle Quote Link to comment https://forums.phpfreaks.com/topic/282324-method-will-not-run/#findComment-1450457 Share on other sites More sharing options...
requinix Posted September 20, 2013 Share Posted September 20, 2013 It is not possible to get the results you're getting with what you've shown and described. Something is different. What is the exact code for your Model class and for the code having the problems? Quote Link to comment https://forums.phpfreaks.com/topic/282324-method-will-not-run/#findComment-1450478 Share on other sites More sharing options...
DFulg Posted September 20, 2013 Share Posted September 20, 2013 Do you have both error_reporting set to E_ALL and display_errors set to 'On'? Quote Link to comment https://forums.phpfreaks.com/topic/282324-method-will-not-run/#findComment-1450482 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.