I am trying to show a sum result of a column name ref_com from wp_users table in my wordpress site.For this I have written following code but it is showing an Array text as output value.What's wrong I am doing? Below is my code
<?php
$result=$wpdb->get_results("SELECT sum(ref_com) as result FROM ".$wpdb->prefix."users WHERE referredby = '$username'");
echo $result;
?>