Unable to submit form to database in custom module I am building a custom module and I'm unable to get the form to talk to the database. The section for uploading to the file system works fine.

This is MyModuleBlock.php

&lt;?php

namespace Drupal\my_module\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;

use Drupal\my_module;

/**
 *  @Block(
 *    id = "my_module",
 *    admin_label = @Translation("Add Image"),
 *  )
 */

class ImageBlock extends BlockBase {
  /**
   * {@inheritdoc}
   */
  public function build() {
      // stuff here;
  }

  /**
   * {@inheritdoc}
   */
  public function blockForm($form, FormStateInterface $form_state) {

    $form = parent::blockForm($form, $form_state);
    $config = $this-&gt;getConfiguration();

    $form['image'] = array(
      '#title' =&gt; t('My Module'),
      '#type' =&gt; 'managed_file',
      '#upload_location'=&gt; 'public://images/',
      '#required' =&gt; FALSE,
    );

    $form['submit'] = array(
      "#type" =&gt; 'submit',
      '#value' =&gt; 'Upload',
    );

    return $form;
  }


  /**
   * {@inheritdoc}
   */

  public function submitForm($form, FormStateInterface $form_state) {
      MyModuleDB::add();
  }
}


The MyModuleDB.php (I am trying out plain text to see if any errors or anything pops up):

&lt;?php

namespace Drupal\my_module;

class MyModuleDB {
    static function add(){
        db_insert('my_table')
            -&gt;fields(array('image' =&gt; 'img1'
            ))-&gt;execute();
    }
}


I'm at a total loss here. The tutorials I've found claim that this should work out fine, but it isn't working for me at all. I even tried inserting into the database directly from submitForm() in the main block class. I also tried to add redirects to the submitForm(). I'm thinking the issue is in that function, but I don't see what the issue could be.
If you write a block, use \Drupal\Core\Block\BlockPluginInterface::blockSubmit for submission