So I figured out how to display the column names from the table with
<?php
$dbhost = 'localhost';
$dbname ='database';
$dbuser = 'root';
$dbpass = 'pass';
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
?>
<select name="selectname">
<?php
$result = mysql_query("SHOW COLUMNS FROM my_database")
or die(mysql_error());
while($nt=mysql_fetch_row($result)){
echo "<option value=" . $nt[0] . ">" . $nt[0] . "</option>";
}
?>
</select>
How do I select only specific columns, as I only want the ones with location names?