| Index
» Projects
» phpMyEdit
» Forum
» Str replace that does not work |
 |
Topshed9
Joined: 14 Jan 2008
Posts: 34
Posted: 2012-04-07 14:19
Back to top
Reply with quote
|
I have been using code to replace a Str in phpmyadmin fo some time but it now fails every time
I found the code in here in a reply from Doug
| Code: |
SELECT `lms`
SET `cut` = REPLACE('cut' , `Co.,Troon` , 'Co.Troon' );
|
I am trying to remove the commer before Troon
Various advice is that REPLACE should only be used with SElECT is that the problem ??
any help most welcome
Topy
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-04-07 15:16
Back to top
Reply with quote
|
Your syntax is incorrect.
http://dev.mysql.com/doc/refman/5.0/en/update.html
Back up your table before attempting to run:
| Code: |
| UPDATE `lms` SET `cut` = REPLACE('cut' , 'Co.,Troon' , 'Co.Troon'); |
|
Topshed9
Joined: 14 Jan 2008
Posts: 34
Posted: 2012-04-07 15:47
Back to top
Reply with quote
|
Hi Doug, Glad I followed your reminder about backing up
The corrected code replaced the cut field to cut all 15556 of them
Gulp....
Regards Topy ...
|
|
Post new topic
Reply to topic
|
|
|
|