It looks like you could add the
MAX( comment_date ) last_commented_date
to the field list to get the latest date, each user commented.
Then use e.g. the human_time_diff()
function to get a human readable text for how long ago each user commented.
human_time_diff( strtotime( $result->last_commented_date) )
For safety reasons, you should then prepare the SQL statement with $wpdb->prepare()
, since it contains the user input $amount
.