I want to create a MySQL syntax to select a field based on a variable, what I have is:
book_category = "science"
mycursor_a.execute(("SELECT {book_categories} FROM research_papers WHERE book_Name = %s", (book,)).format(book_categories = book_category))
but I get the following error:
AttributeError: 'tuple' object has no attribute 'format'