8 lines
284 B
Python
8 lines
284 B
Python
import sqlite3
|
|
conn = sqlite3.connect('backend/sale.db')
|
|
cursor = conn.cursor()
|
|
cursor.execute("SELECT id, name, price FROM products ORDER BY id DESC LIMIT 25")
|
|
print("Products in database:")
|
|
for row in cursor.fetchall():
|
|
print(f" ID: {row[0]}, Name: {row[1]}, Price: {row[2]}")
|