When pulling flavors from a mySQL database, I want to strip the last comma from the array, however I'm not sure how to do this. Any suggestions? The stripped down code is below with the comma I want stripped in bold red:
$query2 = "SELECT flavors from chip_stan_flav";
$result2 = @($query2) or Die("Couldn't execute query");
while ($row2 = mysql_fetch_array($result2)) {
printf ("%s, ",
$row2[flavors]);
}
Thanks,
Mike