cc
import sqlite3
def view_database():
conn = sqlite3.connect("test.db")
cursor = conn.cursor()
cursor.execute("SELECT * FROM users")
rows = cursor.fetchall()
if rows:
for row in rows:
print(row)
else:
print("No data found in the users table.")
conn.close()
if __name__ == "__main__":
view_database()
Comments
Post a Comment