0

This is the error message I'm getting:

mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'letters' in 'field list'

def log_request(req: 'flask_request', res: str) -> None:
    """Log details of the web request and the results."""

    with UseDatabase(app.config['dbconfig']) as cursor:
        _SQL = """insert into log
                  (phrase, letters, ip, browser_string, results)
                  values
                  (%s, %s, %s, %s, %s)"""
        cursor.execute(_SQL, (req.form['phrase'],
                              req.form['letters'],
                              req.remote_addr,
                              req.user_agent.browser,
                              res, ))
David Buck
  • 3,752
  • 35
  • 31
  • 35
Rod E
  • 13
  • 4
  • 1
    The error is self explanatory, what do you mean **resolve**? – Countour-Integral Jan 28 '21 at 07:17
  • I'm really new to programming and like I mentioned I was following along with a project from a book. do you mind explaining the error to me because I'm lost. – Rod E Jan 28 '21 at 08:37
  • @RodE Look at the accepted answer to the question that is linked at the top. You just need to add change your `%s` to `'%s'` – David Buck Jan 28 '21 at 17:59

0 Answers0