Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Server Side Coding
MySQL

How do I do a search and replace on entries in my MySQL database? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5747" title="Pages that link to How do I do a search and replace on entries in my MySQL database?" rel="nofollow" >How do I do a search and replace on entries in my MySQL database?\

There are many tricks that can help.

If you are just looking to trim an entry then you can use string functions to quickly remove part of an entry.

If you are looking for something more complex (like changing the name of a company or altering links inside text) then you may need to use Pattern matching (LIKE or regular expressions) and pos. some processing before updating the specific entry.

It depends on how complex your data and requirements are.
(Please note: While like is reasonably fast, a regular expression match will usually slow down your server quite a bit).

----------------------------
Relevant threads:

MySQL HELP

----------------------------
Relevant FAQs:

How do I create a keyword search in MySQL?

----------------------------
Relevant links:

3.3.4.7 Pattern Matching - MySQL Manual on using LIKE and regular expressions.

6.3.2 String Functions - MySQL Manual on String Functions

_____________________
Emperor



(Edited by: Tyberius Prime on Tue 08-Jul-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu