I want to fetch multiple rows from mySQL in Python, put in a string on new line each.
mycursor.execute("SELECT ProductName FROM products ;")
if mycursor.rowcount == 0:
products = "No Products."
else:
products = ""
for row in mycursor.fetchall():
products += "{ProductName} ".format(**row)
For the above code, I get below error:
str.format() argument after ** must be a mapping, not tuple