input: Write a function to create a Flask application that handles form submissions containing name, email, and phone fields, and stores the data in a SQLite database. If successful, the function should return a redirect to the home page. If the given form fields are missing or invalid, return a message indicating the error.
  assert create_flask_form_app(['name', 'email', 'phone'])==None
  assert create_flask_form_app([])==None
output: 
  def create_flask_form_app(fields):
      from flask import Flask, request, redirect, render_template_string
      import sqlite3
  
      app = Flask(__name__)
  
      @app.route('/submit', methods=['POST'])
      def submit():
          if not all(field in request.form for field in fields):
              return "Missing or invalid fields", 400
  
          name = request.form['name']
          email = request.form['email']
          phone = request.form['phone']
  
          conn = sqlite3.connect('form_data.db')
          cursor = conn.cursor()
          cursor.execute('''CREATE TABLE IF NOT EXISTS submissions
                            (name TEXT, email TEXT, phone TEXT)''')
          cursor.execute('INSERT INTO submissions (name, email, phone) VALUES (?, ?, ?)',
                         (name, email, phone))
          conn.commit()
          conn.close()
  
          return redirect('/')
  
      return app
  