title: PHP: Fatal error: Call to undefined method case_controller
body: <p>I have difficulties trying to call a function even though i have already used "require_once". I'm not sure if the $caseCtrl is even being defined, which could explain the reason why I can't use retrieveAllCaseID() (in create_case.php file).</p>
  
  <p>Here's the flow: create_case.php (user interface/form) -> case_controller.php -> caseDAO.php</p>
  
  <p><strong>This is my error:</strong></p>
  
  <pre><code>Fatal error: Call to undefined method case_controller::retrieveAllCaseID() in \dct\view\create_case.php on line 82
  </code></pre>
  
  <p><strong>create_case.php file:</strong></p>
  
  <pre><code>require_once(dirname(__FILE__) . '\..\controller\case_controller.php');
  $caseCtrl = new case_controller();
  $caseCtrl-&gt;retrieveAllCaseID(); //this line is calling the error
  </code></pre>
  
  <p><strong>case_cotroller.php file:</strong></p>
  
  <pre><code>function retrieveAllCaseID() {
  $caseDAO = new caseDAO();
  $result_array = $caseDAO-&gt;retrieveAllCaseID();
  
  return $result_array;
  }
  </code></pre>
  
  <p><strong>caseDAO.php file:</strong></p>
  
  <pre><code>function retrieveAllCaseID() {
  $allCaseID = Array();
  
  $dbMgr = new dbManager();
  $conn = $dbMgr-&gt;getDBConnection();
  
  // peform query
  $query = "select case_id from case_report where case_status like '%Follow Up%'";
  $result = mysql_query($query);
  if (!$result) 
  {
    print "&lt;br /&gt;";
    die ('(caseDAO.php-&gt;retrieveAllCaseID)Error in executing query: '.mysql_error());
  }
  
  if (mysql_num_rows($result)==0){
    return null;
  }
  
  while ($resultSet = mysql_fetch_assoc($result)) {
    $allCaseID[]= $resultSet['case_id'];
  }
  
  $dbMgr-&gt;closeDBConnection($conn);
  
  return $allCaseID;
  
  }//retrieveAllCaseID
  </code></pre>
  
  <p>I'm aware that there are similar cases here, but I can't seem to find one that really 'answers' my questions.</p>