title: MySQL query to PHP string stop writing delimiter on last column
body: <p>I am kind of stuck and not sure where to even begin to fix this.  I have a MySQL query that is writing out the records to a string like this:</p>
  
  <pre><code>$values = mysql_query("SELECT Pointer AS Pointer, VNum AS Vnum FROM ".$table."");
  $row = 0;
  while ($rowr = mysql_fetch_assoc($values)) 
  {
    foreach($rowr as $name =&gt; $value)
    {
        $csv_output .= $value."|";
    }
        $csv_output .= "\n";
  }
  </code></pre>
  
  <p>This works great EXCEPT the Vnum value ends up with a <code>|</code> appended to it like this:</p>
  
  <blockquote>
    <p>10467|66|</p>
  </blockquote>
  
  <p>I need to have the values written out like <code>10467|66</code> without the <code>|</code> delimiter after the Vnum value.  How do I handle this?</p>