Skip to content

Instantly share code, notes, and snippets.

@daniel-schroeder-dev
Created August 1, 2021 16:34
Show Gist options
  • Save daniel-schroeder-dev/f103dc37aeb20c225087cc5932ffafdb to your computer and use it in GitHub Desktop.
Save daniel-schroeder-dev/f103dc37aeb20c225087cc5932ffafdb to your computer and use it in GitHub Desktop.
H22 - Lesson 11
def update(post):
connection = get_db()
sql = connection.cursor()
query = """
UPDATE
BlogPosts
SET
Title = ?,
Content = ?,
Author = ?
WHERE
PostId = ?
"""
sql.execute(
query,
[
post["title"], post["content"], post["author"], post["post_id"],
],
)
connection.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment