title: Turning a SQL row into an array
body: <p><strong>PROBLEM</strong>
  I have a set of data that is being output by selecting each dataset and utputting them row by row. </p>
  
  <p><strong>QUESTION</strong>
  Is there a method of fetching this data and storing it as an array that I am then able to out turn into set of string values?</p>
  
  <pre><code>$sql = "SELECT * FROM respondent_data WHERE respondent_firstname = 'John'";
  $result = mysqli_query($conn, $sql);
  
  if (mysqli_num_rows($result) &gt; 0) {
  
    while($row = mysqli_fetch_assoc($result)) {
  
      $categoriesTest[] =   $row["respondent_sdo"];
      $row["respondent_dcto"];
      $row["respondent_ed"];
      $row["respondent_ca"];
      $row["respondent_dhpt"];
      $row["respondent_irt"];
      $row["respondent_gl"];
      $row["respondent_il"];      
  
        // Turn my output into an array ready to be used for the JSON string
  
    }
  
  }
  </code></pre>
  
  <p><strong>EXAMPLE</strong></p>
  
  <p>So each of those values outputs an integer from the column rows I need them to be turned into an array like: 2,4,3,5....</p>