I am trying to get my Python code to count the number of records in my table. However, the Python shell keeps throwing up a "error in your SQL syntax" message. Does anyone have any ideas on what is wrong?
def count_rows(table):
cur.execute(
"SELECT COUNT(*) FROM %s",
(table,)
)
cur.connection.commit()
count_rows("home_service")