forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: mirdonamy on August 29, 2008, 12:07:20 am

Title: Mass Update of Keywords - How to?
Post by: mirdonamy on August 29, 2008, 12:07:20 am
I have a photo gallery with thousands of photos.  I have two friends who just got married and I want to update their name in my keywords, but doing it one by one is a pain.  I can login to PhpMyAdmin, but I'm not exactly sure how to properly export the cpg_pictures table without messing it up.  There are so many check boxes and options! 

If I export it to sql or csv/excel, I can probably "find / replace" their names and then import the file back to PhpMyAdmin. 

My friend suggested an SQL Query, but also mentioned that it may only work if the Keywords field I'm searching for is exact (which it won't be since I use multiple keywords per photo). 

What advice can you, the experts, give me on the fastest, easiest way to find and replace particular words in the Keyword field of the cpg_pictures table?  I don't want to mess up anything.

PS. I'm not a programmer or coder.  I am just tech savvy enough to follow precise direction :)

Arielle
Title: Re: Mass Update of Keywords - How to?
Post by: Joachim Müller on August 29, 2008, 08:51:44 am
What's wrong with the keyword manager that comes with coppermine: http://yoursite.tld/your_coppermine_folder/keywordmgr.php
Title: Re: Mass Update of Keywords - How to?
Post by: Nibbler on August 29, 2008, 11:50:11 am
Code: [Select]
UPDATE cpg_pictures set keywords = REPLACE(keywords, 'oldname', 'newname')
Backup first.
Title: Re: Mass Update of Keywords - How to?
Post by: Αndré on August 29, 2008, 01:39:53 pm
Code: [Select]
UPDATE cpg_pictures set keywords = REPLACE(keywords, 'oldname', 'newname')
Backup first.
If you use this query, it will replace every matching part.

Code: [Select]
REPLACE(keywords, 'meier', 'schmidt')will also replace the "meier" in "kleinmeier", resulting in changing this name to "kleinschmidt".