I'm trying to create a python script which allows me to track the number of hands I have played for a specific date, but I'm having trouble figuring out how to make it work.
Here's what I've got so far, but I haven't quite figured out how to go about getting the number of hands, or select a filter / date for that period.
- Code: Select all
import psycopg2
name = "PlayerMHM0"
conn_string = "host='localhost' dbname='PT4 DB' user='postgres' password='dbpass'"
conn = psycopg2.connect(conn_string)
cursor = conn.cursor()
cursor.execute("SELECT id_player FROM player WHERE player_name = '"+name+"'")
records = cursor.fetchone()
c = records
If there are any python whizzes here, I'd be very grateful for any help.