List:General Discussion« Previous MessageNext Message »
From:afan@afan.net Date:November 18 2005 10:27pm
Subject:case insensitive search
View as plain text  
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

Thread
one product in more categoriesafan@afan.net18 Oct
  • Re: one product in more categoriesSGreen18 Oct
    • Re: one product in more categoriesafan@afan.net18 Oct
    • Re: one product in more categoriesafan@afan.net18 Oct
      • Re: one product in more categoriesPeter Brawley18 Oct
        • Re: one product in more categoriesafan@afan.net19 Oct
          • Re: one product in more categoriesafan@afan.net19 Oct
          • Re: one product in more categoriesPeter Brawley19 Oct
          • Re: one product in more categoriesSGreen19 Oct
            • Re: one product in more categoriesafan@afan.net20 Oct
              • Re: one product in more categoriesPeter Brawley20 Oct
                • Re: one product in more categoriesafan@afan.net20 Oct
                  • Re: one product in more categoriesPeter Brawley21 Oct
              • Re: one product in more categoriesSGreen21 Oct
                • Re: one product in more categoriesafan@afan.net21 Oct
                  • Re: one product in more categoriesSGreen21 Oct
    • Re: one product in more categoriesRhino18 Oct
  • Re: one product in more categoriesRhino18 Oct
    • case insensitive searchafan@afan.net19 Nov
      • Re: case insensitive searchJasper Bryant-Greene19 Nov
        • Re: case insensitive searchafan@afan.net20 Nov
          • Re: case insensitive searchBjörn Persson21 Nov
      • Re: case insensitive searchScott Haneda19 Nov
      • Re: case insensitive searchBjörn Persson19 Nov