How to make this query non-case sensitive? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make this query non-case sensitive? (
/showthread.php?tid=308257)
How to make this query non-case sensitive? -
Lorenc_ - 02.01.2012
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 ^^
Re: How to make this query non-case sensitive? -
Rachael - 02.01.2012
you could try using a query like this
SELECT * FROM table WHERE UPPER(`name`) = UPPER('%s')
Re: How to make this query non-case sensitive? -
Lorenc_ - 02.01.2012
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?