Update databaseUPDATED-alex.py

This commit is contained in:
alexalmeida2001
2020-12-05 19:22:07 +00:00
committed by GitHub
parent 1847513760
commit 2861446546
+12
View File
@@ -125,3 +125,15 @@ def create_rent(custo,email,moviename):
conn.commit() conn.commit()
conn.close() conn.close()
def view_rent(email):
conn = psycopg2.connect("host=localhost dbname=projeto user=postgres password=<REDACTED>")
c = conn.cursor()
c.execute("SELECT * FROM rent WHERE usermail = '" + email + "'")
results = c.fetchall()
for x in results:
print(x)
conn.commit()
conn.close()