Beispiel #1
0
 def update(self):
     if (self.user.isspace() & self.password.isspace()):
         print("数值错误")
         print(self.user + "  and  " + self.password)
     else:
         sql = "update testtb SET pass='******' and updatetime='%s' WHERE name='%s'" % (
             self.user, self.updatetime, self.password)
         db = sql.sqldb(sql)
         db.iud
Beispiel #2
0
 def register(**map):
     timedate = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
     sqlinto="INSERT INTO testtb(name,pass,createTime,updatetime,num) VALUES('%s','%s','%s','%s',%s)"% \
     (map['user'],map['password'],timedate,timedate,'NULL')
     db = sql.sqldb(sqlinto)
     cou = db.iud()
     if (cou == None):
         return False
     else:
         return True
Beispiel #3
0
 def intoor(**map):
     sqlinto = "SELECT * FROM testtb WHERE name='%s'" % (map.get('user'))
     db = sql.sqldb(sqlinto)
     re = db.sel()
     if (len(re) == 0):
         print("没有数据")
         return True
     else:
         print("有数据")
         return False
Beispiel #4
0
 def updatepass(self):
     if (self.user.isspace()):
         print("措地")
     else:
         sqlinto = "SELECT * FROM testtb WHERE name='%s'" % (self.user)
         db = sql.sqldb(sqlinto)
         re = db.sel()
         if (len(re) == 0):
             print("没有这个用户")
         else:
             print("有这个用户哦")
             return re
Beispiel #5
0
 def loginyep(user, password):
     namede = {}
     sqlinto = "SELECT name ,pass FROM testtb WHERE name='%s' and pass='******'" % (
         user, password)
     db = sql.sqldb(sqlinto)
     re = db.sel()
     if (len(re) == 0):
         print("没有数据")
         return False
     else:
         print("有数据")
         for a in re:
             namede = {'name': a[0], 'pass': a[1]}
         print(namede)
         return namede