Re: DB search and case sensitive comparison
| From: | Chris | Date: | Wed, 16 Jul 2008 00:03:31 +0000 |
| Subject: | Re: DB search and case sensitive comparison | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276894@lists.php.net to get a copy of this message | ||
> Now what I need to do is to ensure that the lookup_string is in the
> useragent string and the CASE is the same: IE: Mozilla and not MOZILLA or
> mozilla etc...
Make the database do the work if possible.
mysql> select * from a where a like '%MOZILLA%';
+---------+
| a |
+---------+
| Mozilla |
| MOZILLA |
+---------+
2 rows in set (0.00 sec)
mysql> select * from a where a like BINARY '%MOZILLA%';
+---------+
| a |
+---------+
| MOZILLA |
+---------+
1 row in set (0.00 sec)
--
Postgresql & php tutorials
http://www.designmagick.com/