title: I get this error when a form is called up Fatal error: Call to a member function query() on a non-object in
body: <p>I get this error when ever i try to call up a form Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\civildefenceacademy\studentmanagement\qualifications_table.php on line 13... below is the line of code it is pointing to </p>
  
  <pre><code>&lt;?php include('dbcon.php'); ?&gt;
      &lt;table cellpadding="0" cellspacing="0" border="0" class="table" id=""&gt;
          &lt;thead&gt;
          &lt;tr&gt;
                      &lt;th&gt;Institution&lt;/th&gt;
                      &lt;th&gt;Course&lt;/th&gt;
                      &lt;th&gt;Year&lt;/th&gt;
                      &lt;th class="empty"&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;?php
          ***$student_query = $mysqli-&gt;query("select * from student order by student_id DESC")or die(mysql_error());***
          $student_row = $member_query-&gt;fetch_array();
          $student_id = $student_row['student_id'];
          $query = $mysqli-&gt;query("select * from dependents where student_id = '$member_id'") or die(mysql_error());
          while ($row = $query-&gt;fetch_array()) {
          $id = $row['qualification_id'];
          ?&gt;
          &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $row['institution']; ?&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;?php echo $row['course']; ?&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;?php echo $row['year']; ?&gt;&lt;/td&gt; 
          &lt;td class="empty" width=""&gt;&lt;a href="delete_dependent.php&lt;?php echo '?id='.$id; ?&gt;" class="btn btn-danger"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt; Delete&lt;/a&gt;&lt;/td&gt;
  
  
          &lt;/tr&gt;
      &lt;?php } ?&gt;    
  
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>