I heard back from the client yesterday that when it comes to the "email details" page, they want it sorted out by first name.
Code:
$sql=mysql_query("SELECT contactid, firstname, lastname FROM $table_name");
echo'<select name="ContactID">';
while ($row=mysql_fetch_assoc($sql))
{
$id= htmlentities($row['contactid']);
$firstname= htmlentities($row['firstname']);
$lastname= htmlentities($row['lastname']);
echo "<option value= '$id' >";
echo "$firstname$lastname ";
echo "</option>";
}
echo '</select>';
?>
<br />
<input type="submit" name="submit" value="Send Details">
</form>
Choose which user you want to send details to.
This does work, but I have tried ORDER BY firstname ASC. That didn't work. I tried moving the fields around so first name is first. What am I missing?
Thanks!