I'm making a website in HTML and PHP.
I want to make a dropdown menu using select and also have an input field as well.
Basically I have a mysql database.
Say a table in it is called Project, with columns ID, Name, Budget, Start_date.
I want a dropdown menu that allows me to select the columns: ID, Name, Budget, Start_date.
After the column is selected, I want to be able to input a value (also might be nice if I can specify number vs text for each different column for input type)
<form action="somepage.php" method="GET"> ID: <input type="text" name="Pid" /><br><br>
And then on somepage.php, I will be doing this:
$myvariable = $_GET['Pid']; $sql = "INSERT INTO Project(ID) VALUES('$myvariable' ";
I know how to do all this with multiple input fields with one submit button.
But I want to know how to do this with SELECT dropdown.
Is there some way to tell on the somepage.php what dropdown element was selected?
Because I need to know which column in Table Project that $myvar is supposed to be inserted into.