title: Fatal error: Call to undefined function get_all_subjects() in
body: <p>I am trying to teach myself PHP &amp; MySQL. Please note I am very new to this. Below is the error message I am getting and all the code.</p>
  
  <p>I hope this makes sense!!!</p>
  
  <p>Fatal error: Call to undefined function get_all_subjects() in /Users/darren/Sites/widget_corp/content.php on line 9</p>
  
  <p><em><strong>content.php code</em></strong></p>
  
  <pre><code>&lt;?php require_once("includes/connection.php"); ?&gt;
  &lt;?php require_once("includes/functions.php"); ?&gt;
  &lt;?php include("includes/header.php"); ?&gt;
  &lt;table id="structure"&gt;
  &lt;tr&gt;
  &lt;td id="navigation"&gt;
  &lt;ul class="subjects"&gt;
  &lt;?php
  $subject_set = get_all_subjects(); **// this is the problem line**
  while ($subject = mysql_fetch_array($subject_set)) {
  echo "&lt;li&gt;&lt;a href=\"content.php?subj=" . urlencode($subject["id"]) . 
      "\"&gt;{$subject["menu_name"]}&lt;/a&gt;&lt;/li&gt;";
  $page_set = get_pages_for_subject($subject["id"]);
  echo "&lt;ul class=\"pages\"&gt;";
  while ($page = mysql_fetch_array($page_set)) {
      echo "&lt;li&gt;&lt;a href=\"content.php?page=" . urlencode($page["id"]) .
          "\"&gt;{$page["menu_name"]}&lt;/a&gt;&lt;/li&gt;";
  }
  echo "&lt;/ul&gt;";
  }
  
  ?&gt;
  &lt;/ul&gt;
  &lt;/td&gt;
  &lt;td id="page"&gt;
  &lt;h2&gt;Content Area&lt;/h2&gt;
  
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;?php require("includes/footer.php"); ?&gt;
  </code></pre>
  
  <p><em><strong>This is my functions code</em></strong> it resides in a folder called "includes"</p>
  
  <pre><code>&lt;/php
  // This is where we store all the basic functions
  
  function confirm_query($result_set) {
  if (!$result_set) {
  die("Database selection failed: " . mysql_error());
  }       
  }
  
  function get_all_subjects() {
  global $connection;
  $query = "SELECT * 
  FROM subjects 
  ORDER BY position ASC";
  $subject_set = mysql_query($query, $connection);
  confirm_query($subject_set);
  return $subject_set;
  }
  
  function get_pages_for_subject($subject_id) {
  global $connection;
  $query = "SELECT * 
  FROM pages 
  WHERE subject_id = {$subject_id"} 
  ORDER BY position ASC";             
  $page_set = mysql_query($query, $connection);
  confirm_query($page_set);
  return $page_set;   
  }
  ?&gt;
  </code></pre>