Do you want to right database entry based on the checkboxes selected, or automatically highlight the checkboxes that are in the database as well?
<?php
/*
* Assuming MySQLi initialized as $mysqli
* Assuming <input type="checkbox" name="checkbox[]" />
*/
$found = array();
foreach($_POST['checkbox'] as $checkbox) {
if(!$s = $mysqli->query("SELECT `id`, `value` FROM `table` WHERE `value` LIKE '%$checkbox%'")) {
// No result
} else {
$result = $s->fetch_assoc();
$found[$result['id']] = $result['value'];
}
}
?>