View Full Version : Is there a way to do global edits of the database?
July 31st, 2004, 08:03 AM
Is there a way to do a global edit of the database? For example, can I select all of the pictures in a category, and have an additional keyword inserted, or change a particular keyword to a different keyword?
If there is not a direct PhotoPost approach, is there a desktop approach? I know that I can back up the database. Is there an application that converts the database to a desktop file format (like a spreadsheet) and then converts it back to the PhotoPost format?
July 31st, 2004, 12:53 PM
The only way to mass edit the database is through the mysql replace command where you do a search on a field and replace all keywords with something else.
Now I would be very careful when doing this and backup your database before doing this
UPDATE pp_photos SET keywords = REPLACE(keywords, 'oldkeyword','newkeyword');
Note I used pp_ as the prefix you may need to change it.
August 1st, 2004, 02:01 PM
Using the same strategy, could I insert a keyword in all of the photos in a category (but not all the the photos in the dataset?
Could I do this in a field that I defined myself?
August 1st, 2004, 02:05 PM
Yes, you could. Just tag a WHERE cat=X to the end of the above.
August 1st, 2004, 02:17 PM
As Don said ;)
UPDATE pp_photos SET keywords = REPLACE(keywords, 'oldkeyword','newkeyword') WHERE cat = 'X';
August 2nd, 2004, 06:00 AM
If there is no keyword (so I'm not replacing, I'm inserting a new one) do I leave the "oldkeyword" variable blank, or is there a different command?
Is there a basic summary of the mysql commands somewhere?
Can I copy the image filename into a field, so that when I change the title the filename is still in a field?
August 2nd, 2004, 07:02 AM
UPDATE pp_photos SET keywords='blah' WHERE cat = 'X';
vBulletin® v3.8.1, Copyright ©2000-2015, Jelsoft Enterprises Ltd.