SQL查询结果进入php表

I'm trying to place the results of a SQL query into a table for my wordpress site.

My table is called "statetable"

The columns are "State", "num-Asn" , and "Percent"

The following is my code in my custom php template.

   global $wpdb;
   $results = $wpdb->get_results("SELECT * FROM statetable;");

   echo "<table>";
   foreach($results as $result){
   echo "<tr>";
   echo "<td>".$result->State."</td>";
   echo "<td>".$result->num-ASN."</td>";
   echo "<td>".$result->Percent."</td>";
   echo "</tr>";
   }
    echo "</table>";


    ?>

I get an empty table with one cell filled with zeros. I think this might not be the best way to set it up, or I have the wrong syntax for the foreach loop.

"num-ASN" is an illegal identifier name. Check what's in $results.

Check the content of $results by using

 var_dump($results);