Saturday, May 14, 2011

MYSQL IS NOT CASE SENSITIVE

i thought mysql is case sensitive,but unfortunately it is not case senstive!Here is the rules to make database table fields case sensitive:

CREATE TABLE IF NOT EXISTS wp_affiliate(
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL collate utf8_bin,
`afflink` varchar(50) NOT NULL,
`countt` int unsigned DEFAULT 0,
`countu` int unsigned DEFAULT 0,
`clktime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`comment` varchar(254) DEFAULT '',
PRIMARY KEY(id),
UNIQUE(name)
)
The name field is case sensitive.It's a great thing i discovered while working on wordpress database
Bugs: if your make this change to your table wordpress function may not work(in my case).SO i am using some straight mysql query.

No comments:

Post a Comment