$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) > 0 ) {
Now the part I'm struggling with:
$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 .= ")";
}
I want the output to be something like:
SELECT * FROM `posts` IN (4, 3, 2)
But the code above gives an output like:
SELECT * FROM `posts` IN (4, 3, 2,)
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.