[SOLVED] problem with mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
murthy
Forum Commoner
Posts: 50
Joined: Fri Aug 20, 2004 1:22 am
Location: India
Contact:

problem with mysql

Post by murthy »

Hi,

I am getting problem with Login form.

i.e mysql accepting all values i.e not case sensitive.

ex:

select * from table where username='raju';
GETTING RESULTS;

select * from table where username='RAJU';
GETTING RESULTS;

i have to restrict to this case sensitive.

Thanks,
Murthy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

switch the field/column to binary.
murthy
Forum Commoner
Posts: 50
Joined: Fri Aug 20, 2004 1:22 am
Location: India
Contact:

Post by murthy »

please explain briefly....i didn't get you
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

change the column username to a binary (var)char type:

Code: Select all

ALTER TABLE `table_name` CHANGE `username` `username` VARCHAR( 255 ) BINARY NOT NULL
murthy
Forum Commoner
Posts: 50
Joined: Fri Aug 20, 2004 1:22 am
Location: India
Contact:

Post by murthy »

very thanks ......
Post Reply