Re: Comparing Strings
| From: | Andrey Hristov | Date: | Mon, 25 Mar 2002 13:48:01 +0000 |
| Subject: | Re: Comparing Strings | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17884@lists.php.net to get a copy of this message | ||
If using mysql then the string comparison of fields is case insensitive except if the (var)char
column is BINARY.
AFAIK mysql has support for RegEx-es. If you decide to use PHP, then use preg_match/replace but with
'i' modifier. This will make
the search case-insensitivi and will be faster than eregi().
Regards,
Andrey Hristov
----- Original Message -----
From: "John Fishworld" <john@webital.de>
To: <php-db@lists.php.net>
Sent: Monday, March 25, 2002 12:59 PM
Subject: [PHP-DB] Comparing Strings
> Whats the best way to compare 2 strings (city names - one in db one user
> entry)
> At the moment I'm thinking to do the following ;
>
> strip spaces
> convert to lower
> and then compare !
>
> Has anyone got any better/other suggestions ??
>
> regards
> John
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>