Skip to content

Instantly share code, notes, and snippets.

@1stevengrant
Created September 2, 2013 14:12
Show Gist options
  • Save 1stevengrant/6413309 to your computer and use it in GitHub Desktop.
Save 1stevengrant/6413309 to your computer and use it in GitHub Desktop.
sql to update the image files on bulk after a CSV upload of dogs. The image files must match the url_title of the dog which, by default is the same as the dog's name but in lowercase
UPDATE exp_channel_data cd
INNER JOIN exp_channel_titles ct
ON cd.entry_id = ct.entry_id
SET cd.field_id_9 = CONCAT('{filedir_2}', ct.url_title, '.jpg')
WHERE ct.channel_id = '2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment