def log_user(req: 'MyRecipe') -> None: with dataBase(app.config['dbconfig']) as cursor: str = """insert into userInfo(Fname,Lname,passwd,email_id) values (%s,%s,%s,%s) """ cursor.execute(str, ( req.form['Fname'], req.form['Lname'], req.form['password'], req.form['email'], ))
def valid_user(req: 'MyRecipe') -> int: with dataBase(app.config['dbconfig']) as cursor: str = """select count(*),Fname from userInfo where passwd = %s and email_id = %s """ cursor.execute(str, ( req.form['password'], req.form['email'], )) a = cursor.fetchall() return a
def valid_user(req: 'login') -> int: with dataBase(app.config['dbconfig']) as cursor: str = """select count(*),name,email,userId from usrInfo where password = %s and email = %s """ cursor.execute(str, ( req.form['password'], req.form['email'], )) a = cursor.fetchone() return a
def appoint_data(req: 'Appointment', doc: 'doctor', fee: 'fee') -> None: with dataBase(app.config['dbconfig']) as cursor: str = """insert into appoint(doc_name,patient_name,time,phn_number,fee) values (%s,%s,%s,%s,%s) """ cursor.execute(str, ( doc, session['name'], req.form['time'], req.form['contact'], fee, ))
def log_recipe(email: 'String', rname: 'String', loc: 'String') -> bool: with dataBase(app.config['dbconfig']) as cursor: try: str = """insert into rcp_file(email,RCname,RCloc) values (%s,%s,%s)""" cursor.execute(str, ( email, rname, loc, )) except: return False return True
def log_user(req: 'Register') -> None: with dataBase(app.config['dbconfig']) as cursor: str = """insert into usrInfo(name,email,sex,state,city,address,password) values (%s,%s,%s,%s,%s,%s,%s) """ cursor.execute(str, ( req.form['name'], req.form['email'], req.form['sex'], req.form['state'], req.form['city'], req.form['address'], req.form['password'], ))
def my_recipe(email: 'String') -> list: with dataBase(app.config['dbconfig']) as cursor: str = """select RCname,RCloc from rcp_file where email = %s""" cursor.execute(str, (email, )) data = cursor.fetchall() return data