title: Is it possible to fetch table headers with mysqli statement?
body: <p>I'm trying to output the column names dynamically based on the table being query. I'm wondering if it is possible to fetch the column names directly using the statement object like stmt-&gt;fetch_fields / stmt-&gt;fetch_column_names. Aside from using the resultset to get the column names, is there a way to fetch the column names directly with the statement?</p>
  <pre><code>while($field = $result-&gt;fetch_field()) {
      $out .= '&lt;th&gt;' . $field-&gt;name . '&lt;/th&gt;';
  }   
  </code></pre>