PDA

View Full Version : database


chriz
7th of October 2003 (Tue), 11:03
A question,

I uploaded 150 pictures in a new exhibition and have the wrong location and photographer.

Is it possible to bulk-change the values for the location fields from within EE-editor ?

Which table could I manually (phpmyadmin) edit to change country and city ?

Thanks
Chriz

Pekka
7th of October 2003 (Tue), 11:26
To replace location id 2 with 3:

UPDATE ee_photo
SET ee_location_id = '3'
WHERE ee_location_id = '2'

to replace country id 2 with 191:

UPDATE ee_country
SET ee_country_id = '191'
WHERE ee_country_id = '2'

THESE COMMAND REPLACE ALL REGARDLESS OF PHOTO ID. If you need to do above to specific photos, then you may e.g. do

UPDATE ee_country
SET ee_country_id = '191'
WHERE ee_country_id = '2'
AND ee_photo_id > '200'

(all photos above id 200 are affected)

You can enter the commands in PhpMyadmin's SQL tab.

Note: I do not give any warranty of EE's functionality after manual database editing. So be aware of what you are doing in PhpMyAdmin (and take backups first).

chriz
7th of October 2003 (Tue), 11:50
Thank you for the explanation.

That will be much faster than deleting pictures, uploading again, ...

Chriz

chriz
7th of October 2003 (Tue), 12:22
Better safe than sorry,

what you mean is:
UPDATE ee_photo // select table ee_photo for update
SET ee_country_id = '124' //Netherlands
WHERE ee_country_id = '160' //Spain
AND ee_photo_id > '3889'
AND ee_photo_id '3889'
AND ee_photo_id

Pekka
7th of October 2003 (Tue), 15:34
[quote]chriz wrote:
Better safe than sorry,

what you mean is:
UPDATE ee_photo // select table ee_photo for update
SET ee_country_id = '124' //Netherlands
WHERE ee_country_id = '160' //Spain
AND ee_photo_id > '3889'
AND ee_photo_id '3889'
AND ee_photo_id = '3889'