Skip to content

Instantly share code, notes, and snippets.

@bgogul
Last active August 12, 2021 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgogul/e5904ddf010341a26d9a547fe4aa10c4 to your computer and use it in GitHub Desktop.
Save bgogul/e5904ddf010341a26d9a547fe4aa10c4 to your computer and use it in GitHub Desktop.
# import mysql.connector
# mydb = mysql.connector.connect(
# host="localhost",
# user="myusername",
# password="mypassword",
# database="mydatabase"
# )
# mycursor = mydb.cursor()
# sql = "SELECT * FROM customers WHERE address = 'Park Lane 38'"
# mycursor.execute(sql)
# myresult = mycursor.fetchall()
# for x in myresult:
# print(x)
customers = sqldb("mydatabase")
# Following gets staged and when needed converted to sql query to get data
# "SELECT * FROM customers WHERE address = 'Park Lane 38'"
[print (x) for x in customers if f.address = `Park Lane 38']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment