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 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. 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 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. 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.. 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 Quote 28 pages to sort thru Well that's funny. Because when I click that link I posted I arrive immediately at Quote 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... Link to comment https://forums.phpfreaks.com/topic/260491-replace-update-a-typo/#findComment-1335145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.