Fix insertPlayer so that it works again

This commit is contained in:
Worros 2009-08-08 12:33:25 +08:00
parent d905b6e780
commit 08a70b75f2

View File

@ -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.