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
精彩评论