title: PHP MySQL how to set column/field names into variables after fetch_assoc
body: <p>I am trying to get column names and the values, and then set the column names into variables... Does it make sense?</p>
  
  <pre><code>$con = mysqli_connect('localhost', 'mysql_user', 'mysql_password', 'db_name');
  $sql = "SELECT * FROM `table`";
  $res = mysqli_query($con,$sql);
  while($row = $res-&gt;fetch_assoc()) {
      $column1 = $row['column1']; // &lt;- can these be
      $column2 = $row['column2']; // as simple as one
      ...
      $column100 = $row['column100']; // line or two?
  }
  mysqli_close($con);
  </code></pre>
  
  <p>Can anyone guide me how to do that? Thanks.</p>