I have a table called "Registration" for registering into clubs with the following columns 'clubName' and 'registrationStatus' clubName contains the name of clubs and registrationStatus contains one of these three, open, closed, or extended. In my HTML form I have select input. In the options I want to have from the database club names whose status are open and extended only. Or all the names of clubs but those with status closed will not be active. In my code I have the following
<?php
//connection to database
include "connect.php";
?>
<label for="club">Select club to join</label>
<select name="club" >
<?php
$result = "SELECT clubName FROM Registration WHERE Status= 'Open' OR Status='Extended'";
//I'm stuck here now how to display the options and how will I attach value to them for entry into the database
?>
</select>