# db = mysql.connector.connect()
result = []
cursor = db.cursor()
cursor.execute("SELECT field FROM table")
for x in cursor.fetchall():
result.append({"field": x[0]})
cursor.close()
return result
Query MySQL database
sample of query for MySQL
Shortcut: mysql.query.select
0 Comments
Add Comment
Log in to add a comment