Exemplo n.º 1
0
def insert_new(params, id):
    sql = "insert into user values (%s,%s,%s,%s)"
    db = mysqlhelper()
    if Isid(id):
        db.update(sql, params)
        return True
    else:
        return False
Exemplo n.º 2
0
def Isname(param):
    sql = "select password from user where name=%s"
    db = mysqlhelper()
    rs = db.select_psword(sql, param)
    # print(rs)
    if not rs:
        #print("数据库中没有")
        return False
    else:
        #print("数据库中有")
        return True
Exemplo n.º 3
0
def Isid(param):
    sql="select password from user where name=%s"
    db=mysqlhelper()
    rs=db.select_psword(sql,param)
   # print(rs)
    if not rs:
        return True
    else:
        return False
#Isid("www")
#Isid("qqqq")
Exemplo n.º 4
0
from DBHelper.MysqldbHelper import mysqlhelper

sql = "delete from user where name=%s"
sql2 = "insert into user values (%s,%s,%s,%s)"
sql3 = "select password from user where name ='asd'"
db = mysqlhelper()
db.update(sql2, ('qqqqqqqqqqq', 'asd', '123456', 'wqwqwqw'))
print(db.select_psword(sql3))
if db.select_psword(sql3) == "asd":
    print("True")
else:
    print("False")
if db.select_psword(sql3)[0] == "asd":
    print("True2")
else:
    print("False2")
print(db.select_psword(sql3)[0])
print(db.select(sql3))
Exemplo n.º 5
0
def IsPaaword(param):
    sql = "select password from user where name=%s"
    db = mysqlhelper()
    rs = db.select_psword(sql, param)
    # print(rs)
    return rs[0]
Exemplo n.º 6
0
def update_password(params):
    sql = "update user set password=%s where name=%s"
    db=mysqlhelper()
    #if Isid(id):
    db.update(sql, params)
    return True