This seems to be a bit out of my league and knowledge of MySQL. So if someone can help it would be much appreciated.
I would like to do the following:
- Enter/define a keyword e.g.
mercedes
- Find all K2 articles that have that keyword in the title
- Than to each of those articles assign my keyword
mercedes
as a tag.
Now... There are three tables with relevant columns listed:
k2_items
id
, title
k2_tags
id
, name
, published
(value 1 is assigned if tag is published)
k2_tags_xref
id
, tagID
, itemID
So, query should select all items from k2_items
table that have keyword
in their title, check if keyword
is already defined as tag
in k2_tags
, if not than create a new tag. After that, new k2_tags_xref
entry should be generated to connect keyword
tag with K2 article item.
I still didn't have database course on my university so I'm kind of out of my league with this one, and it was supposed to be just a simple touchup for the site I'm developing.
Any help with this would be much appreciated, and I'm sure it'll help community later on.
Thanks!