Topshed Posted April 7, 2012 Share Posted April 7, 2012 mySQL ver: 5.1.30 PHP ver: 5.2.8 I have a typo in over 400 records and I want to fix it in phpmyadmin The field is tinytext and the string I am trying to fix is 91 chars long I am trying to fix a small section of the string My efforts are a dismal failure ie: UPDATE lms SET cut = 'Co.T' WHERE cut = 'Co.,T' Your help would be most welcome Topshed Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/ Share on other sites More sharing options...
requinix Posted April 7, 2012 Share Posted April 7, 2012 Try REPLACE. Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335126 Share on other sites More sharing options...
Topshed Posted April 7, 2012 Author Share Posted April 7, 2012 Thanks for the reply, but no Joy, assuming that you ment REPLACE lms SET cut = 'Co.T' WHERE cut = 'Co.,T' Topshed Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335128 Share on other sites More sharing options...
requinix Posted April 7, 2012 Share Posted April 7, 2012 What I meant was for you to click the link and read what it pointed to. That's why I put it there. Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335129 Share on other sites More sharing options...
Topshed Posted April 7, 2012 Author Share Posted April 7, 2012 Thanks for the clarification but unfortunatly 28 pages to sort thru was not the quick fix I was looking for, rather just a correction to my inept code Regards.. Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335144 Share on other sites More sharing options...
requinix Posted April 7, 2012 Share Posted April 7, 2012 28 pages to sort thru Well that's funny. Because when I click that link I posted I arrive immediately at REPLACE(str,from_str,to_str) Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching for from_str. mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww'); -> 'WwWwWw.mysql.com' This function is multi-byte safe. Maybe your Internet isn't the same as my Internet... Quote Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335145 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.