I have this array from the checkbox
<?php
$query = $handler->query("SELECT * FROM colors");
while ($row = $query->fetch()) {?>
<input type="checkbox" name="check_list[]" id="<?php echo $row['id']?>" value="<?php echo $row['hex'];?>">
<?php } ?>
PHP Query
<?php
if(!empty($_POST['check_list'])) {
foreach($_POST['check_list'] as $check) {
$query = $handler->query("INSERT INTO images (color_tags) VALUES ('$check')");
}
}
?>
I want to insert the data's from the array without inserting it on every row I want it to be just separated in commas like data1,data2,data3 then insert it.