This repository has been archived on 2021-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
ravaBot/db.py

20 lines
709 B
Python
Raw Normal View History

2020-08-03 19:28:55 +02:00
import psycopg2
conn_DB=psycopg2.connect("dbname='NOM DE TA BASE DE DONNEE' user='PSEUDO DE TA BASE DE DONNEE' host='IP DE TA BASE DE DONNEE' password='MOT DE PASSE DE TA BASE DE DONNEE'")
cur = conn_DB.cursor()
cur.execute("""SELECT id_user, nom_usuel, dernier_message_XP, experience, dernier_message_meme, position FROM users""")
rows = cur.fetchall()
for row in rows:
print("ID = {} ".format(row[0]))
print("NOM USUEL = {}".format(row[1]))
print("DERNIER MESSAGE XP = {}".format(row[2]))
print("XP = {}".format(row[3]))
print("DERNIER MESSAGE MEME = {}".format(row[4]))
print("POSITION = {}".format(row[5]))
print("\n")
#input("Press enter for quit...")