ffrr
  
else:
   username = pyinputplus.inputEmail('Username (must be existing email): ', limit=3)
   cur.execute('SELECT * FROM database WHERE userID = "' + str(username) + '"')
   bas = cur.fetchone()
   print(str(bas[5]))
  
import sys
 
...
 
else:
    username = pyinputplus.inputEmail('Username (must be existing email): ', limit=3)
    cur.execute('SELECT * FROM database WHERE userID = %s', (username,))
    bas = cur.fetchone()
    if bas is None:
        print('error: No such user', file=sys.stderr)
        sys.exit(1)
    print(str(bas[5]))