jaymc Posted December 1, 2006 Share Posted December 1, 2006 I have the following username in my database[code]????s???????????????[/code]However, I cant find where it is! And it wont appear in a search such as[code]SELECT * FROM `members` `username` = "????s???????????????"LIMIT 0 , 30[/code]I have a feeling the '?' character is confusing MYSQL.I need to find and delete that entry, any ideas how? Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/ Share on other sites More sharing options...
HuggieBear Posted December 1, 2006 Share Posted December 1, 2006 Try:[code]SELECT * FROM `members` WHERE `username` LIKE '%?%';[/code]See what that brings up, as far as I'm aware, the '?' isn't a wild card in MySQL, however, the '%' and '_' are.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-133544 Share on other sites More sharing options...
jaymc Posted December 1, 2006 Author Share Posted December 1, 2006 Didnt return anythingBasically what im trying to do, is convert a field from ascii_binary to ascii_general so that it is not case sensitiveHowever, to acheieve that, their cant be any duplicate usernamesWhen I try and change it to ascii_general it tells me that their is a duplicate entry of that username with all the question marks[code]SQL query:ALTER TABLE `members` CHANGE `username` `username` VARCHAR( 20 ) CHARACTER SET armscii8 COLLATE armscii8_general_ci NOT NULLMySQL said: Documentation#1062 - Duplicate entry '????s???????????????' for key 2 [/code]really stuck Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-133564 Share on other sites More sharing options...
jaymc Posted December 3, 2006 Author Share Posted December 3, 2006 Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-134322 Share on other sites More sharing options...
fenway Posted December 3, 2006 Share Posted December 3, 2006 Try WHERE username LIKE '____s%' Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-134490 Share on other sites More sharing options...
jaymc Posted December 3, 2006 Author Share Posted December 3, 2006 Nope, that just returned 19 pages of 30 rows, checked through each manually and it wasnt theirThis is a nightmare.Surely their must be a more straight forward way to convert from Binary to Ascii... on a field that is uniqueIs their any way to force it and delete any duplicates it finds Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-134505 Share on other sites More sharing options...
fenway Posted December 3, 2006 Share Posted December 3, 2006 There's no guarantee it'll be unique after, especially if the collation ends up with non-printable character for the random code it encounters. Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-134518 Share on other sites More sharing options...
jaymc Posted December 3, 2006 Author Share Posted December 3, 2006 Sorted !!The question marks where not actually question marksThey where just being shown on screen as question marks because of the charsetI did this to narrow the search resultsTry WHERE username LIKE '____s___________%'And it came up fineNow convertedThanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/29131-database-headache/#findComment-134520 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.