SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Mainer82's Avatar
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Replace one word without removing other words?

    I have a blog that has about 100 entries or so; I need to replace the word lightbox in each of those entries, there may be multiple lightboxes in each post.

    Is there a query that I can run that will do this? I can search for all of the words, but can't figure out how to replace it.
    Get to know the man behind the screen

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Code:
    UPDATE dablogentries
       SET entrytext = REPLACE(entrytext,'lightbox','accordion')
     WHERE entrytext LIKE '%lightbox%'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict Mainer82's Avatar
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, thank you very much. I found a few articles but this one worked. Thank you again.
    Get to know the man behind the screen


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •