Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Mass Update of Keywords - How to?  (Read 2185 times)

0 Members and 1 Guest are viewing this topic.

mirdonamy

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Mass Update of Keywords - How to?
« 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Mass Update of Keywords - How to?
« Reply #1 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
Logged

Nibbler

  • Guest
Re: Mass Update of Keywords - How to?
« Reply #2 on: August 29, 2008, 11:50:11 am »

Code: [Select]
UPDATE cpg_pictures set keywords = REPLACE(keywords, 'oldname', 'newname')
Backup first.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Mass Update of Keywords - How to?
« Reply #3 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".
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.