Woocommerce Subscriptions: How can I display value from table at external database at custom column at my-account/subscriptions?

I am building a site with Wordpress, Woocommerce and the Woocommerce Subscriptions plugin. For starters I have the following table with columns 'Subscription', 'Status', 'Next Payment', 'Total' and 'Usage'(custom column) which is the terabytes of the product I am selling, that my customers use.

<thead>
    <tr>
        <th class="subscription-id order-number woocommerce-orders-table__header woocommerce-orders-table__header-order-number woocommerce-orders-table__header-subscription-id"><span class="nobr"><?php esc_html_e( 'Subscription', 'woocommerce-subscriptions' ); ?></span></th>
        <th class="subscription-status order-status woocommerce-orders-table__header woocommerce-orders-table__header-order-status woocommerce-orders-table__header-subscription-status"><span class="nobr"><?php esc_html_e( 'Status', 'woocommerce-subscriptions' ); ?></span></th>
        <th class="subscription-next-payment order-date woocommerce-orders-table__header woocommerce-orders-table__header-order-date woocommerce-orders-table__header-subscription-next-payment"><span class="nobr"><?php echo esc_html_x( 'Next payment', 'table heading', 'woocommerce-subscriptions' ); ?></span></th>
        <th class="subscription-total order-total woocommerce-orders-table__header woocommerce-orders-table__header-order-total woocommerce-orders-table__header-subscription-total"><span class="nobr"><?php echo esc_html_x( 'Total', 'table heading', 'woocommerce-subscriptions' ); ?></span></th>
        <th class="subscription-total order-total woocommerce-orders-table__header woocommerce-orders-table__header-order-total woocommerce-orders-table__header-subscription-total"><span class="nobr"><?php echo esc_html_x( 'Usage', 'table heading', 'woocommerce-subscriptions' ); ?></span></th>
        <th class="subscription-actions order-actions woocommerce-orders-table__header woocommerce-orders-table__header-order-actions woocommerce-orders-table__header-subscription-actions">&nbsp;</th>
    </tr>
</thead>

What I want is to print at the column 'Usage' a percentage of the used terabytes. I want that percentage coming from a table at an external database. Let's say that table will have the 'sub_id' column which is the subscription id(int) and the column 'space_usage' which is the percentage of used tera(varchar) Below you can see an example of my table.

+--------+-------------+
| sub_id | space_usage |
+--------+-------------+
|   3247 | 100%        |
|   3249 | 100%        |
+--------+-------------+

Now to get these values, first I connect to the database and execute the query to get the space usage. Let's suppose I want to to get only one value (that's why I have 'limit 1'). When I try to echo that one value at the 'Usage' column I get the result that you see at the image I attach. Could someone suggest smth. Thank you. Below you can see the rest of the code at my-subscriptions.php.

my-account/subscriptions

   <tbody>
    <?php /** @var WC_Subscription $subscription */ ?>
            <?php
                $username = '...';
                $password = '...';
                $database = '...';
                $host = '...';

                //create new wpdb instance
                $mydb = new wpdb($username, $password, $database, $host);
                $qry_sub_id = $mydb->get_results("select sub_id from sub_id_and_usage");
                $qry_usage = $mydb->get_results("select space_usage from sub_id_and_usage limit 1");
                $qry = $mydb->get_results("select * from sub_id_and_usage", ARRAY_A);
                //$row = mysql_fetch_row($qry_usage);

                //foreach($qry as $row){
                //    $test = $row->space_usage;
                //}


            ?>


    <?php foreach ( $subscriptions as $subscription_id => $subscription ) : ?>
        <tr class="order woocommerce-orders-table__row woocommerce-orders-table__row--status-<?php echo esc_attr( $subscription->get_status() ); ?>">
            <td class="subscription-id order-number woocommerce-orders-table__cell woocommerce-orders-table__cell-subscription-id woocommerce-orders-table__cell-order-number" data-title="<?php esc_attr_e( 'ID', 'woocommerce-subscriptions' ); ?>">
                <a href="<?php echo esc_url( $subscription->get_view_order_url() ); ?>"><?php echo esc_html( sprintf( _x( '#%s', 'hash before order number', 'woocommerce-subscriptions' ), $subscription->get_order_number() ) ); ?></a>
                <?php do_action( 'woocommerce_my_subscriptions_after_subscription_id', $subscription ); ?>
            </td>
            <td class="subscription-status order-status woocommerce-orders-table__cell woocommerce-orders-table__cell-subscription-status woocommerce-orders-table__cell-order-status" data-title="<?php esc_attr_e( 'Status', 'woocommerce-subscriptions' ); ?>">
                <?php echo esc_attr( wcs_get_subscription_status_name( $subscription->get_status() ) ); ?>
            </td>
            <td class="subscription-next-payment order-date woocommerce-orders-table__cell woocommerce-orders-table__cell-subscription-next-payment woocommerce-orders-table__cell-order-date" data-title="<?php echo esc_attr_x( 'Next Payment', 'table heading', 'woocommerce-subscriptions' ); ?>">
                <?php echo esc_attr( $subscription->get_date_to_display( 'next_payment' ) ); ?>
                <?php if ( ! $subscription->is_manual() && $subscription->has_status( 'active' ) && $subscription->get_time( 'next_payment' ) > 0 ) : ?>
                <br/><small><?php echo esc_attr( $subscription->get_payment_method_to_display( 'customer' ) ); ?></small>
                <?php endif; ?>
            </td>
            <td class="subscription-total order-total woocommerce-orders-table__cell woocommerce-orders-table__cell-subscription-total woocommerce-orders-table__cell-order-total" data-title="<?php echo esc_attr_x( 'Total', 'Used in data attribute. Escaped', 'woocommerce-subscriptions' ); ?>">
                <?php echo wp_kses_post( $subscription->get_formatted_order_total() ); ?>
            </td>
            <td class="subscription-actions order-actions woocommerce-orders-table__cell woocommerce-orders-table__cell-subscription-actions woocommerce-orders-table__cell-order-actions">
            <a href="<?php echo esc_url( $subscription->get_view_order_url() ) ?>" class="woocommerce-button button view"><?php echo $qry_usage;?></a>
                <?php do_action( 'woocommerce_my_subscriptions_actions', $subscription ); ?>
                </td>
        </tr>
    <?php endforeach; ?>
    </tbody>