Remove space and replace with _ in phpMyAdmin

2019-09-09 12:08发布

问题:

Basically I want to take a row in a table which has entries 'example entry' and turn them into 'example_entry'. There are thousands of entries so I don't want to do it manually, obviously. How would I do this?

回答1:

Try this:

UPDATE your_table
SET your_field = REPLACE(your_field, ' ', '_')


回答2:

Try with the following query:

UPDATE table SET field = REPLACE(field, ' ', '_');