Multiple value selection of php can handle two atrribut in a selection

I want to ask how adding the selection can handle 2 values ​​in an example of choice: in the data, students have 2 attributions id and name in the selection box only visual name and if the choice of any name attributes id to the choice.
Thank you for helping
my coding

Room
prefix. "room";
$ sql = "SELECT * FROM $ table_name WHERE name_room ASC";
$ rows = $ wpdb-> get_results ($ sql);
?>

—- select ROOM —-
nama_room & # 39; "> & # 39 ;. $ row-> nama_room. & # 39; & # 39 ;;
}
?>