| Replace text Replace text in multiple rows |
TheKiller

msg:4416851 | 11:16 pm on Feb 12, 2012 (gmt 0) | Well hello, I know you may replace text from a sql table by using something like the fallowing:
UPDATE phpbb_posts SET post_text = replace(post_text, 'ÃŽ', 'Î'); But would there be a way to replace something from two rows at once? Something ilke this:
UPDATE phpbb_posts SET post_text, post_subject = replace(post_text, post_subject, 'ă', 'Î;'); I know there could be just a second update line of code that does that separtely, but can you do it from just one line? Like you do for example:
UPDATE phpbb_topics SET topic_time = '1329086612',topic_views = '0' WHERE topic_id =747 ; Thanks in advance.
|
Dijkgraaf

msg:4426693 | 10:58 pm on Mar 8, 2012 (gmt 0) | Yes, you can set multiple columns at a time and accross multiple rows UPDATE phpbb_posts SET post_text = replace(post_text, 'ă', 'Î;'), post_subject = replace(post_subject, 'ă', 'Î;') WHERE ...;
|
TheKiller

msg:4449693 | 12:22 am on May 5, 2012 (gmt 0) | Thanks mate. I dont need it anymore as i just wanted to help a forum owner that has messed up his db.
|
|
|