<?php
// Make a MySQL Connection
mysql_connect("HOST_NAME", "USERNAME", "PASSWORD") or die(mysql_error());
mysql_select_db("DB_NAME") or die(mysql_error());
$checkBox = implode(',', $_POST['Colors']);
if(isset($_POST['submit']))
{
$query="INSERT INTO clr_tbl (colors) VALUES ('" . $checkBox . "')";
mysql_query($query) or die (mysql_error() );
echo "Complete";
}
?>
<html>
<body>
<form method="post" action="">
<input type="checkbox" name="Colors[]" value="Red">Red<br>
<input type="checkbox" name="Colors[]" value="Blue">Blue<br>
<input type="checkbox" name="Colors[]" value="Pink">Pink<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
INSERT INTO my_table SELECT * FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table s
WHERE s.my_col >= 10;
INSERT INTO table2
(name, email, phone)
SELECT name, email, phone
FROM table1;