I'm creating some admin tools for a site to search for various things such as state, zip, e-mail, id number and print results according to the input. Right now it is working fine, but the database that it's pulling the info from has some states that are uppercase, lowercase, and mixed. I want to be able to type in say "PA" and have it return all the info with states that are "pa", "Pa", or "PA"
Any variations of case. Right now it will only pull what you type in and this is the code I am using:
if(!empty($_POST["s_state"]))
{
echo "State Search for <b>" . $_POST['s_state'] . "</b>:<BR>";
$temp_state = str_replace(" ", "", trim($_POST["s_state"]));
$query = "Select dm_id, dm_first_name, dm_last_name, dm_phone from distributor_main where dm_state LIKE '$temp_state%'";
display_invoice_search_results($query);
}
Any help is appreciated.