title: MySQL PHP printf into $variable adding additional value
body: <p>I'm experiencing something strange, and I can't figure out why it's happening. I'm running a query to pull data from a column in a mysql table, and when I do a straight <code>printf()</code>, the data comes out as expected. However, when I do <code>$variable = printf()</code>, I'm getting an additional value in the string.</p>
  
  <p>The following prints something like:
  22611,21435,23327,22876,22986,23692,21581,21832,22337,24313,22174,24368,</p>
  
  <pre><code>$query  = "SELECT column FROM table WHERE year in (2012)";
  if ($result = mysqli_query($connect, $query)) {
      while ($row = mysqli_fetch_assoc($result)) {
          printf ("%s,", $row["column"]);
      }
  }
  </code></pre>
  
  <p>But if I try to put the result into a variable like so:</p>
  
  <pre><code>$data = printf ("%s,", $row["column"]);
  </code></pre>
  
  <p>I get an output of
  22611,21435,23327,22876,22986,23692,21581,21832,22337,24313,22174,24368,6</p>
  
  <p>Why is it adding this extra value? Am I adding the result to the variable incorrectly? FYI, this is just a snippet from the code, I have error handling in place.</p>