Hi, ok I have about 1600 records in a mySQL db. Many of them have a forward slash "/" in the itemName column. In my site, I am passing the itemName as a URL variable on many search forms, so obviously the forward slash is not a good naming convention to use.

IS there a way to go in my db and find and replace all instances on the forward slash? I usually use navicat for db management, and it has a find feature, but you have to replace each forward slash it finds by hand. Thanks for any suggestions in advance!

Recommended Answers

All 4 Replies

For a table named 'items':

update items set itemName = replace(itemName,'/','');

Awesome! This will only replace the "/" in the column I specify correct? What I mean is there are forward slashes in other columns, but since they are not used in variables I might pass in a url, I want to leave them. Thanks!

Yes, it replaces only the specified string in the specified column. Forward slashes in other columns won't change.

                        THANK U
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.