My drop down box selection box is created dynamically with data from a mysql database.
It is a list of artists/musicians. I have 1 column in the db table called artist_name and another called artist_id. The sql query selects both of these columns and displays artist names in the select box.
What I need is for the artist_id to be sent along with whichever artist is selected in the select box to the next page upon submitting the form.
I put in a input field, which I will make hidden eventually. But I want the input field to change to whatever the correct id is when the select box is changed.
Here is the php/mysql code I have so far:
$query4 = "SELECT artist_id,artist_name FROM artists ORDER BY artist_name";
$result4 = mysql_query($query4) or die(mysql_error());
echo "<select name='artist'>
<option value=''>Select Artist</option>";
echo "<option value='". $row['artist_name'] ."'>". $row['artist_name'] ."</option>";
<input type='text' name='artist_id' id='artist_id' size='5' class='textfield' value='$artist_id'>";