How to make this query non-case sensitive?
#1

Hi all, I have this query where my OnPlayerConnect is to catch whether the player is registered though the only problem with it is that it's case sensitive which I don't really want to use.

I've already have about 3,000 player's registered in 2 days, it'd be a total nightmare to destroy their work put into the server I have...

pawn Код:
format( Query, sizeof( Query ), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s'", DB_Escape( name ) );
Result = db_query( Database, Query );
I'm not sure how to do this though, asking for help here. MYSQL doesn't be a bitch like SQLite does, so i'm wondering if anyone has a answer to this.

Just to make sure no-one gets confused about my using my mysql query:
pawn Код:
format(query, sizeof(query), "SELECT * FROM `player_data` WHERE NAME = '%s' LIMIT 0,1", ReturnPlayerName(playerid));
mysql_query(query);
Probably a less efficient option there ^^
Reply
#2

you could try using a query like this

SELECT * FROM table WHERE UPPER(`name`) = UPPER('%s')
Reply
#3

Quote:
Originally Posted by Rachael
Посмотреть сообщение
you could try using a query like this

SELECT * FROM table WHERE UPPER(`name`) = UPPER('%s')
I'm currently looking @ http://stackoverflow.com/questions/9...ring-comparing

"WHERE name = 'someone' COLLATE NOCASE"

Looks like a effective way. Now all I need to do is check for any account duplicates, with some query :O

Does anyone know such a query that dumps duplicated entries?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)