开发者

PHP mySQL - replace some string inside string

i want to replace ALL comma , into ,<space> in all address table in my mysql table.

For example,

+----------------+----------------+
| Name           | Address        |
+----------------+----------------+
| Someone name   | A1,Street Name |
+----------------+----------------+

Into

+----------------+----------------+
| Name           | Address        |
+----------------+----------------+
| Someone name   | A1, Street Name|
+--------开发者_如何学C--------+----------------+

Thanks in advance.


UPDATE tabl SET Address = REPLACE(Address, ',', ', ')

Back up your table before trying it out!

You can read more about replace function here: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜