Welcome Guest, Not a member yet? Register   Sign In
Lost in the shuffle
#1

[eluser]nZac[/eluser]
I am somehow losing data between two functions that should work well together. The functions work in other situations but not here:

Code:
//Function 1
function get_questions($test_id)
{
  errorLog('Testing_Center::get_questions() called',1);
  $test_info = $this->get_test($test_id);
  //test is null
  $q_file = $this->get_questions_file($test_info);        
}

//Function 2
function get_test($test_id)
{
  errorLog('Testing_Center::get_test() called',1);
  $test = $this->xml->get_test_info($test_id);
  //$test will return a correct value
  return $test;
}

$this->get_questions(1);

So what is happening is when function 2 gets the test info it var_dump()'s the proper output but when I put a var_dump in function 1 it spits out NULL.

Why would the data disappear?
#2

[eluser]Damien K.[/eluser]
Your functions are procedure-level -- I'm surprise it even works using $this. Wink
#3

[eluser]nZac[/eluser]
Damien,

there is a class wrapper around this with about 1000+ other lines, most of which are unrelated to the problem. I think I figured it out and now have it working.

Thanks Smile




Theme © iAndrew 2016 - Forum software by © MyBB