From 08a70b75f201f3eb94a8eff8f7891094fb904e62 Mon Sep 17 00:00:00 2001 From: Worros Date: Sat, 8 Aug 2009 12:33:25 +0800 Subject: [PATCH] Fix insertPlayer so that it works again --- pyfpdb/Database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 9204b01d..8c03a249 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1043,7 +1043,7 @@ class Database: c.execute ("SELECT id FROM Players WHERE name=%s".replace('%s',self.sql.query['placeholder']) ,(name,)) tmp = c.fetchone() - if (len(tmp)==0): #new player + if (tmp == None): #new player c.execute ("INSERT INTO Players (name, siteId) VALUES (%s, %s)".replace('%s',self.sql.query['placeholder']) ,(name, site_id)) #Get last id might be faster here.