Getting error in sql query

You have a typo

$a = the_ID(); 
$data = $wpdb->get_results("SELECT `id`,`guid` FROM `wp_posts` WHERE `post_type` = 'local-offer' group by `post_author`");
$result = $wpdb->get_results("SELECT * FROM `wp_postmeta` WHERE `post_id` = ".$a." ");