Using mysqli code, I have been able to create a dropdown box using data from a mysql database. The sql statement selects the userId, f_Name, and l_Name from the database. This list is part of a form and when the user selects the name, I want to pass only the userId via the $_Post method. How can that be done? Thanks again for your help.
<select name="names">
<option value = "">---Select---</option>
<?php
$queryusers = 'SELECT userID, f_Name, l_Name FROM users';
$db = mysqli_query($mysqli, $queryusers);
while ( $names=mysqli_fetch_assoc($db)) {
echo "<option value='{".$names['f_Name']."}' .
{".$names['l_Name']."}'>".$names['f_Name']. " " .
$names['l_Name']."</option>";
}
?>
</select>