Minor change to insertPlayer()
This commit is contained in:
parent
cbc010155d
commit
679393e78d
|
@ -1040,8 +1040,13 @@ class Database:
|
||||||
def insertPlayer(self, name, site_id):
|
def insertPlayer(self, name, site_id):
|
||||||
result = None
|
result = None
|
||||||
c = self.get_cursor()
|
c = self.get_cursor()
|
||||||
c.execute ("SELECT id FROM Players WHERE name=%s".replace('%s',self.sql.query['placeholder'])
|
q = "SELECT name, id FROM Players WHERE siteid=%s and name=%s"
|
||||||
,(name,))
|
q = q.replace('%s', self.sql.query['placeholder'])
|
||||||
|
|
||||||
|
print "DEBUG: name: %s site: %s" %(name, site_id)
|
||||||
|
|
||||||
|
c.execute (q, (site_id, name))
|
||||||
|
|
||||||
tmp = c.fetchone()
|
tmp = c.fetchone()
|
||||||
if (tmp == None): #new player
|
if (tmp == None): #new player
|
||||||
c.execute ("INSERT INTO Players (name, siteId) VALUES (%s, %s)".replace('%s',self.sql.query['placeholder'])
|
c.execute ("INSERT INTO Players (name, siteId) VALUES (%s, %s)".replace('%s',self.sql.query['placeholder'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user