In the website, I am trying to make (for educational and personal purposes only) I have a SQL table which I am trying to inject data into. On this PHP page, I have added the ability to create tables ' a competition ' and I want to be able to list all created tables on an option list, however, I cannot work out how to display each competition created separately on their own line.
There are many partial solutions already out there on StackOverflow and the 'wide web' but I cannot seem to find a solution for a drop down option list in HTML
<button class = button type="submit" form="Update" value="create climbs" onclick="onButtonClick() ">Add New climb</button>
<p></p>
<form method = "post" action="admin.php">
<input class = "hide" type="text" name = "climbname" id="climbname" placeholder= "Climb Name" />
<select class = "hide" type="text" name = "comp" id="competiton" placeholder= "Which comp">
<option value="2019axis">2019AXIS</option>
<option value="2019annual">
<?php
$db = mysqli_connect("localhost", "root", "", "authentication");
$result = mysqli_query($db,"show tables");
while($table = mysqli_fetch_array($result)) {
echo($table[0]."<br>" ); } ?>
</option>
</select>
As shown in the screenshot http://prntscr.com/mddlbg, all competitions are listed together on one line. However, I only want the first 2 tables shown in the SQL database http://prntscr.com/mddlo7.
I understand this may be a very easy solution, however, any help is greatly appreciated.