if (!isset($_POST['search']) || $_POST['search'] == '')
{
echo 'no search entered';
}
if nothing is posted in set in the input area 'search' OR what is posted in search is equal to '', then echo 'no search entered'
$search = $_POST['search'];
$query = "SELECT my_fields FROM my_table WHERE fields_im_searching LIKE '%$search%'";
}
if that is not true, then the variable $search is equal to the value in the input area 'search'. then, the variable $query is equal to the SQL statement selecting whatever fields you want (my_fields) from whatever table (my_table) where fields_im_searching (whatever fields you want to match the search input to) is like what was inputted..
however, nothing initiates the query, you can either add this
mysql_query($query);
or change it to
$query = mysql_query("SELECT my_fields FROM my_table WHERE fields_im_searching LIKE '%$search%'");