5

I used zoo member/safecracker to allow registered members submit 1 entry (application form) a few months back. I now need to open this form back up for submissions again. I need to save the original submissions in the database but need to remove the registered members so they can submit again.

I believe that the author of the entries needs to be changed before the members are deleted.

Does anyone know of a plug-in to change the author of multiple entries (1000 aprox) or what syntax to use for the database query.

7

Your SQL query would look something like this:

UPDATE exp_channel_titles SET author_id = XX WHERE entry_id IN(34,278,45,91, [...]);

You'll want to run a Recount Statistics afterwards as well.

(If there was something common to all of these entries, you could possibly incorporate more into the query that would prevent you from having to have a comma-delimited list of all the entry_ids hard-coded.)

  • If you want to change the author of all entries in a channel you can use ... WHERE channel_id = ID (where ID is the id number of the channel to update). – Andrew Weaver Dec 5 '12 at 13:25
  • 1
    Also, I think you only need to do the first UPDATE. I don't think the exp_channel_data table has an author_id field. – Andrew Weaver Dec 5 '12 at 13:27
  • Totally correct Andrew, my bad - updated my answer. – Derek Hogue Dec 5 '12 at 13:30
  • Ok thanks Derek, and Andrew. From my (limited) understanding I need to run UPDATE exp_channel_titles SET author_id = XX WHERE entry_id IN(34,278,45,91, [...]); listing the entry_ids as the author_id is not available using WHERE channel_id. I think I'll do a backup first :) – Micky Kelleher Dec 5 '12 at 22:52
  • What Andrew was saying is that if you want to change the author for every entry in this particular channel, you could use WHERE channel_id = XX instead of WHERE entry_id IN([your comma-separated list of entry_ids]). – Derek Hogue Dec 5 '12 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.