Below WordPress database error is coming:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 for query SELECT * FROM wp_author_followers WHERE author_id = made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'),
Here is my code.
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}author_followers WHERE author_id = $author_id", OBJECT );
$followcounter = count($results);
return $followcounter;