Skip to content

Instantly share code, notes, and snippets.

@llbbl
Last active June 2, 2022 15: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 llbbl/a9ea97494cbf8ee81aeba892c41b5967 to your computer and use it in GitHub Desktop.
Save llbbl/a9ea97494cbf8ee81aeba892c41b5967 to your computer and use it in GitHub Desktop.
sql = "INSERT INTO likes ( user_id, post_id ) VALUES ( %s, %s )"
val = [(4, 5), (3, 4)]
cursor = connection.cursor()
cursor.executemany(sql, val)
connection.commit()
print("query executed")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment