I've never heard that it's valid to compare an integer to an array, neither is there any indication in the PHP docs that it is so. This is not perl, after all.
Even if it were, even if it yielded the number of elements in the array, using <= would be invalid and would attempt to access one element past the end.
Furthermore, because array entries can have string indices, you're not even guaranteed to get anything by looping a numeric index.

There are only two reliable ways of looping over complete arrays, and those are foreach and while(each) loops. There's no reason not to use them either.
Code:
foreach($result_array as $subarray) {
    echo "    <tr>\n";
    foreach ($subarray as $data){
        echo "      <td>$data</td>\n";
    }
    echo "    </tr>\n";
}