>>> e=searchengine.searcher('searchindex.db')
>>> e.getmatchrows('functional programming') select w0.urlid,w0.location,w1.location from wordlocation w0,wordlocation w1 where w0.urlid=w1.urlid and w0.wordid=10 and w1.wordid=17
SyntaxError: invalid syntax
# it highlights the word select in the program
How do I correct this syntax error of the select statement? I am using Python with sqlite3.
APerson
8,4588 gold badges39 silver badges49 bronze badges
1 Answer 1
You can't just plonk SQL into a python file. This error message is python telling you "I have no idea what select is".
To be more helpful, you'd need to share what library you got "searchengine" from, but no matter what that is, your code is not valid python, so there's no way it's going to work.
answered Oct 28, 2014 at 3:40
GreenAsJade
14.7k11 gold badges69 silver badges103 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
tripleee
And quite possibly just
e.getmatchrows('functional programming') may be all you actually need.default