title: Comma inside MySQL query
body: <pre><code>$sql_query_posts = "SELECT * FROM `posts`";
  
  $sql_form_permission = mysql_query("SELECT * FROM `integrations` WHERE `rank_id`='$user_level' AND `mode`='form_per'");
      if ( mysql_num_rows($sql_form_permissions) &gt; 0 ) {
  </code></pre>
  
  <p>Now the part I'm struggling with:</p>
  
  <pre><code>   $sql_query_posts .= " IN (";
      while ( $row_form_permissions = mysql_fetch_assoc($sql_form_permissions) ) { 
      $sql_query_posts .= $row_form_permissions['form_id'] . ",";
      }
      $sql_query_posts .= ")";
      }
  </code></pre>
  
  <p>I want the output to be something like: </p>
  
  <pre><code>SELECT * FROM `posts` IN (4, 3, 2)
  </code></pre>
  
  <p>But the code above gives an output like:</p>
  
  <pre><code>SELECT * FROM `posts` IN (4, 3, 2,)
  </code></pre>
  
  <p>So I have to get rid of the comma at the end. How can I make sure the script disables the comma at the last row.</p>