distal-attribute
distal-attribute
distal-attribute
distal-attribute

change value in text type field

javi_m posted 4 years ago in Running SQL scripts
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 posted 4 years ago
UPDATE <yourtable> SET <colname> = REPLACE(<colname>, 'from_str', 'to_str')
javi_m posted 4 years ago
Thanks a lot anse!

Cheers

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