Update databaseUPDATED-alex.py

This commit is contained in:
alexalmeida2001
2020-12-05 19:22:07 +00:00
committed by GitHub
parent eb0054aa2b
commit 8082bf226e
+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=postgres")
c = conn.cursor()
c.execute("SELECT * FROM rent WHERE usermail = '" + email + "'")
results = c.fetchall()
for x in results:
print(x)
conn.commit()
conn.close()