title: Showing column names
body: <p>This class is for managing a database through mysqli. I'm stuck on the prepared statement to show all the column names of a given table.</p>
  
  <pre><code>class databaseManager {
      function showTable ($tableName, $mysqli) {
          $stmt = $mysqli -&gt; prepare("SHOW COLUMNS FROM ?");
          $stmt -&gt; bind_param('s', $tableName);
          $stmt -&gt; execute();
  
          while ($stmt -&gt; fetch) {
              $Field;
          }
  
          $stmt -&gt; free_result();
      }
  }
  </code></pre>
  
  <p>I get the error "Call to a member function bind_param() on a non-object", but $mysqli connection exists so I suppose the mysqli -> prepare is wrong.</p>
  
  <p>EDIT: clearly I passed $mysqli</p>
  
  <pre><code>$databaseManager = new databaseManager();
  $databaseManager -&gt; showTable("blog", $mysqli);
  </code></pre>