I wrote some code for checking the table for existing row and then if the id does not exist, the code inserts new row. Here is the code
x.execute("SELECT id FROM headlines WHERE id="+ pid)
numrows = int (x.rowcount)
if numrows<1:
sql=""'insert into headlinesUS (id,feed_url,item_title,item_date,fetch_date)
values ("%s","%s","%s","%s","%s");'''
x.execute(sql, (pid,url,title,date,fetch))
connection.commit()
print("\n- " + title)
But when i run it i receive this error:
numrows = int (x.rowcount)
^
IndentationError: unindent does not match any outer indentation level