PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Wed Feb 16, 2005 3:02 pm
I have some content from an LMS here that has our old domain in it that I need to just replace with our new domain (for img references and hrefs).
is it possible to do a "search" on the table field for the old domain and replace it with the new domain?
my alternative is to export the data, open a text editor and do a find and replace there, then re-import the data.
I'd like to avoid that if possible.
Burr
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Feb 16, 2005 3:08 pm
what's wrong with writing a bit of a script to search the table, then update each record found updating the table as it goes?
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Wed Feb 16, 2005 3:10 pm
yes thought about that after I posted.
gonna give that a go...
thx,
Burr
jonemo
Forum Commoner
Posts: 28 Joined: Wed Feb 09, 2005 1:32 pm
Location: london, uk
Post
by jonemo » Wed Feb 16, 2005 3:31 pm
you can use REGEXP() in where statements. however you cannot use something like [p/e]reg_replace on the database.