coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Daethian on July 27, 2008, 07:54:31 PM

Title: Bulk add keywords via PhpMyadmin?
Post by: Daethian on July 27, 2008, 07:54:31 PM
I don't know much about editing tables but I know it can be done.  I have one set of keywords I would like to add to an entire album. Instead of doing it through the gallery itself it seems like it would go faster to use PhpMyAdmin and insert.  Is this possible and would someone be willing to help me with the proper syntax for accomplishing this? My SQL version: 4.1.22-standard

Title: Re: Bulk add keywords via PhpMyadmin?
Post by: Nibbler on July 27, 2008, 08:03:38 PM
If you don't have any existing keywords then use

UPDATE cpg_pictures SET keywords = 'foo' WHERE aid = 123;

If you want to add to a set of existing keywords use

UPDATE cpg_pictures SET keywords = CONCAT(keywords, ' ', 'foo') WHERE aid = 123;

Change cpg to the prefix you use, foo to the keywords (space separated) and 123 to the album number.
Title: Re: Bulk add keywords via PhpMyadmin?
Post by: Daethian on July 27, 2008, 08:32:01 PM
Thanks so much! I'll give it a shot :)
Title: Re: Bulk add keywords via PhpMyadmin?
Post by: Daethian on July 27, 2008, 08:38:43 PM
It worked!! Thanks again so much you have made my life so much easier!!!  *happy dance*