www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Using UPDATE to change a stored URL

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Ables Springs, Texas
    Posts
    139

    resolved [RESOLVED] Using UPDATE to change a stored URL

    Is it possible to use UPDATE to change a stored URL?

    I have a stored URL something like this: http://www.mysite.com/library/article-name.php

    I want to change all URLs in the database with that format to: http://www.mysite.com/library/titles/article-name.php

    Is there an easier way to do this than manually changing one entry at a time?

    Tried using "UPDATE articles SET url='http://www.mysite.com/library/titles/%' WHERE url='http://www.mysite.com/library/%'". Doesn't work, nor does using LIKE instead of =.

  2. #2
    Join Date
    Oct 2006
    Location
    Ables Springs, Texas
    Posts
    139
    Resolved: UPDATE articles SET url = REPLACE(url, '/library/', '/library/titles/')

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles