I\'ve got an argument tag and I perfomed this way:
tag
cursor.execute(\"SELECT * FROM posts WHERE tags LIKE \'%?%\'\", (tag,))
but
Remove the %:
%
cursor.execute("SELECT * FROM posts WHERE tags LIKE ?", (tag,))
This should format it as you wanted. For example, if tag == 'test' the full query would be:
tag == 'test'
SELECT * FROM posts WHERE tags LIKE 'test'