Working code for adding widget to wp dashboard with information from custom DB:
/**
* Add application widget to the dashboard.
*/
function addApplicationWidget() {
wp_add_dashboard_widget(
'submitted_applications',
'Submitted Applications',
'showApplicants'
);
}
add_action( 'wp_dashboard_setup', 'addApplicationWidget' );
function showApplicants() {
global $wpdb;
$appTable = $wpdb->prefix . "applications";
$query = $wpdb->prepare("SELECT * FROM $appTable WHERE %d >= '0'", RID);
$applications = $wpdb->get_results($query);
foreach ( $applications as $application ) {
echo $application->title . " " . $application->app_firstName . " " . $application->app_surName . "<br/>";
}
}