Re: Case sensitive search

From: Date: Sun, 18 Jul 2004 21:15:24 +0000
Subject: Re: Case sensitive search
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35348@lists.php.net to get a copy of this message
Hi, i suggest you to use the LIKE operator instead of the relational operator. Rui Cunha Rosen writes:
Hi, I have a simple table: test ( id int unsigned NOT NULL auto_increment, data varchar(30) default NULL, PRIMARY KEY (id)) with two simple records:
id      data
1       "a"
2       "A" 
When I perform "select * from test where data='a' " - it return me both rows. By default in MySQL comparing of strings is case-insensitive. How can I perform a case sensitive search in text fields ? Tnanks in advance, Rosen
*************************************
* Rui Pedro Cunha                   *
* Dpto. de Ciências e Tecnologias * * Universidade Autónoma de Lisboa *
* Rua de Santa Marta, 56,           *
* 1169-023 Lisboa                   *
* Telefone (+351) 21 317 76 35/49 *
* Fax       (+351) 21 353 37 02     *
* Url : http://www.ual.pt/dct/      *
* E-mail: rui.cunha@ual.pt          *
************************************* 


« previous php.db (#35348) next »