SQL query and slots values

Hello. I have this code embedded with custom actions, it works fine until it reaches to the query line

conn = mysql.connector.connect(host=“localhost”,

  •                                       port="3306",
    
  •                                       user="root",
    
  •                                       password="",
    
  •                                       database="chatbot_db")
    
  •        mycursor = conn.cursor()
    
  •        branch_tawjihi=tracker.get_slot("branch_of_tawjihi")
    
  •        mark_branch=tracker.get_slot("mark_of_branch")
    
  •        print("\n\n"+branch_tawjihi+"\n\n"+mark_branch+"\n\n"+"before query execution\n")
    
  •        mycursor.execute("""SELECT major_name FROM chatbot_db.majors WHERE 
    
  •        min_gpa<={mark} AND tawjihi_branch LIKE {branch}""".format
    
  •        (mark = float(mark_branch), branch = branch_tawjihi))
    
  •        result= mycursor.fetchall()
    
  •        print("after query and before loop")
    
  •        print(text=(result))
    

the slots values are printed but then as i mentioned above, it goes to the except and show failure message. I also tried to give static data in the query but nothing changes. glad to any help…