change value in text type field

[expired user #5254]'s profile image [expired user #5254] posted 13 years ago in Running SQL scripts Permalink
Hi Everyone!

I need some help with this.

I¡m using Joomla!, wich as default parameter puts all the article images in a single folder.

So, i need to reorder that images. That's not a problem itself. The problem is to give the joomla articles the new image path.

For example: OLD path: mysite.com/images/stories/image.jpg
NEW path: mysite.com/images/stories/NEWFOLDER/image.jpg

The image path is stored in a text type field, so... how can i change the paths with a sql script?

Like... change images/stories to images/stories/NEWFOLDER in all the records from x field, in x table... ?

Cheers!

(Sorry about my poor english)
ansgar's profile image ansgar posted 13 years ago Permalink
UPDATE <yourtable> SET <colname> = REPLACE(<colname>, 'from_str', 'to_str')
[expired user #5254]'s profile image [expired user #5254] posted 13 years ago Permalink
Thanks a lot anse!

Cheers

Please login to leave a reply, or register at first.