Using PHP Code Snippets to query a database, $dbconnection->get_results is outputting nothing

Either you have a typo or your syntax is incorrect for this line:

$dbconnection = new $wpdb($username, $password, $dbname, $hostname );

It should be:

$dbconnection = new wpdb($username, $password, $dbname, $hostname ); (no $ in referencing the wpdb class)