Get results from wordpress data custom table

It seems you issue is with the below code piece:

if ( $results ) {
    foreach ( $results as $result ){
       echo $result[0];
    }
}

echo $result[0]; should just be echo $result;.

$results is your array so to use $results[0] (note the s) you would need a for loop and not a foreach loop.

if ( $results ) {

    $arrLen = count($results);

    for ($i = 0; $i < $arrLen; $i++ ){
       echo $result[$i];
    }
}

is what you want if you want to use $results[n] targeting.