RE: Case sensitive search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Two options:

1. Use ALTER to make the field BINARY.

2. Use the BINARY modifier in your SELECT

"select * from test where BINARY data='a'




-----Original Message-----
From:	Rosen [mailto:rosen@xxxxxxxxxxxxxx]
Sent:	Sun 7/18/2004 2:45 AM
To:	php-db@xxxxxxxxxxxxx
Cc:	
Subject:	Case sensitive search
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




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux