selecting options from another form

In the following line: $select_branch = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name"));, you are using $wpdb->prepareincorrectly. wpdb::prepare needs two arguments, first one is a Query string with sprintf like placeholders and second an array of the values to to substitute the placeholders. More details here. And that is the error you are getting as posted on top of your question.