title: SQL SELECT tables with PHP
body: <pre><code>$sql = "SELECT table_name FROM information_schema.tables WHERE table_type = 'base table' AND table_schema='PPcontent';";
  $query = mysqli_query($con, $sql);
  
  while($result = mysqli_fetch_array($query)){
      echo "&lt;option value=\"", $result[0], "\"&gt;", $result[0], "&lt;/option&gt;";}
  </code></pre>
  
  <p>I am trying to get a handle on mysqli objects and how they work. I have the above query that I am using to find the table names of a database and insert them into a select dropdown. When I used similar code to populate another select dropdown I used <code>$result['some_row_name']</code> to fetch the results when the while loop runs. Then my select statement was <code>SELECT 'some_row_name from 'some_table'</code>   When I do it with the select statement above I need to use the index 0 instead of "Table_name". Why is that? When I run the select statement above in PHP MyAdmin I get a table back with the row name 'Table_name' so I would think I would use that as an index instead of 0.  </p>