Keyword

SQL query to change all author ID of all k2 items

More
9 years 7 months ago #140478 by Terry
Hi,
Can someone tell me the SQL query to run in phpmyadmin for this:

I need to change all the 'created by' IDs in K2 items to one specific super-user ID.

I think it is something like:

k2_items table

UPDATE `myprefix_k2_items` SET created_by = superuser-id WHERE created_by = previous-superuser-id

But I would sooner someone verify this for me please?

many thanks,
T.

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #140498 by Lefteris
Hi,

Yes the query seems correct but i strongly recommend to backup the items table before executing this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #140523 by Terry
Thank you Lefteris,
That has worked, ie - replacing all k2 items authorship with one specific ID to another specific ID.

But could you tell me what SQL statement I should use to replace ALL articles to be one authored by one specific user?

Would it be using the 'asterix'.

SET created_by = new-superuser-id WHERE created_by *

Am I thinking correctly?
Or does the * need to be like this: '*'.

many thanks,
T.

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #140687 by Lefteris
No, asterisk is not needed. Just use:
UPDATE `myprefix_k2_items` SET created_by = superuser-id 

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum