Mysql How to insert a variable as field value in a table I have created a variable named hash as a password hash. How can this variable be inserted a a field value in a table?

hash = pbkdf2_sha256.encrypt("password", rounds=200000, salt_size=16)
cur.execute("insert into meanu(username,pwdhash1) values('BV2',hash)")
produces following error:
mysql_exceptions.OperationalError: (1054, "Unknown column 'hash' in 'field list'")
mysql_exceptions.OperationalError: (1054, "Unknown column 'hash' in 'field list'")


cur.execute("insert into meanu(username,pwdhash1) values('BV2','hash')")
inserts the literal "hash" as the field value.
You should insert hash as a parameter following this example:
http://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-execute.html

Something like this

insert_stmt=(
       "insert into meanu (username,pwdhash1)"
       " values('BV2',%s)"
        )
data=(hash)
cursor.execute(insert_stmt, data)