OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
case insensitive search

afanafan.net
Date: Fri Nov 18 2005 - 16:27:10 CST


Hi!

I have this code:

    <form method="post" action="search.php">
        Search:
        <input type="Text" name="SearchSalesperson" size="35" value="<?=
$_POST['SearchSalesperson'] ?>" maxlength="25">
        <input type="Submit" name="SubmitSearch" value="Search">
    </form>

and this
# searching for salesperson
if(isset($_POST['SubmitSearch']))
{
    $SearchSalesperson =
mysql_real_escape_string($_POST['SearchSalesperson']);
    $query = my_query("
                SELECT FName, LName
                FROM Salespersons
                WHERE FName LIKE '%$SearchSalesperson%' OR LName LIKE
'%$SearchSalesperson%'
                ORDER BY LName ASC, FName ASC
            ", 0);
       while($result = mysql_fetch_array($query, MYSQL_ASSOC))
       {
           $SALESMEN[] = preg_replace("/$SearchSalesperson/", "<span
style=\"background-color: gold;\">$SearchSalesperson</span>", $result);
       }
}

but I'm getting case insensitive search?!? it's not the same I enter
afan or Afan or AFAN!??

Any ideas?

Thanks for any help.

-afan

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql