开发者

PHP mySQL - replace some string inside string

开发者 https://www.devze.com 2022-12-31 15:33 出处:网络
i want to replace ALL comma , into ,<space> in all address table in my mysql table. For example,

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

精彩评论

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