Try:
c.execute("SELECT pid FROM posts WHERE title LIKE ?", ('%'+keyWord+'%',))
In your case, you can also use instr
which return the index of the substring you’re searching for (0 otherwise):
c.execute("SELECT pid FROM posts WHERE instr(title, ?) > 0", (keyWord,))
CLICK HERE to find out more related problems solutions.