I have a dropdown list (HTML select box) which gets values from this MySQL query:
"SELECT cdID, cdTitle FROM CD ORDER BY cdID"
The result is then stored in an associative array, which is then output to the dropdown list:
<?php
echo '<select name= "list" id="list">';
while ($row = mysqli_fetch_assoc($result)){
echo '<option value="'.$row['cdTitle'].'">'.$row['cdTitle'].'</option>';
}
echo '</select>';
?>
My issue is that I would like the user to see the title of the CD, but for the actual value to be "cdID" as that is the foreign key used in my database.