Saving data from custom form in wordpress database

You’re checking isset( $_POST['SUBMIT'] ), but there’s no field with that name. If you mean to be checking the submit button, you need to give it a name attribute with the right value:

<input type="submit" name="SUBMIT" value="SUBMIT">

Now isset( $_POST['SUBMIT'] will be true, and your code will run.

Also, you don’t seem to be using $wpdb->prefix correctly. $wpdb->prefix is based on the value entered by the user during installtion, and is used to prefix the database tables automatically created by WordPress, and can be used by plugins to name their tables as well. This prefix is usually wp_, so if your table is named wp_mealplanner, then the table name should be set like this:

$table = $wpdb->prefix . 'mealplanner';

However, if you manually created your table in PHPMyAdmin, then your table’s name isn’t actually based off $wpdb->prefix, so you should just hard-code the name you gave it:

$table="wp_mealplanner";

You would only use $wpdb->prefix to ensure you were querying a table that had been created using $wpdb->prefix in the first place, such as during plugin activation.