how can i search names according to checkbox values from database table

Exg:

In your Form ..

<input type="checkbox" name="chk[]" value="1" />
<input type="checkbox" name="chk[]" value="2" />
<input type="checkbox" name="chk[]" value="3" />

In action page

<?php
if($_POST['chk']) {
$chekedValues=  array();
$chekedValues = $_POST['chk'];
$append="";
foreach ($chekedValues as $key=>$value) {
            $append.=($key==0) ? 'WHERE ' : 'OR';
            $append.= " db_table_field_name="."'".$value."'";
}

$sqlsearch = mysql_query("SELECT * FROM db_table_name ".$append);

    while ($row = mysql_fetch_array($sqlsearch))
        {

        }
}
?>