import sqlite3
# Connect to the database
con = sqlite3.connect('database.db')
# Create a cursor object
cursor = con.cursor()
# Fetch data based on the ID filter
cursor.execute("SELECT * FROM users WHERE id = ?", (123,))
data = cursor.fetchall()
# Print the retrieved data
for row in data:
print(row)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter