Hi,
I have a MySQL database with a table 'room_codes' which has 2 fields, 'room_type' and 'room_code'. I'd like to create a drop down menu that shows the room_type, but has the value of room_code. So far I have the following code but it doesn't work.
<SELECT NAME="room_type">
<?
$getinfo=mysql_query("hkihotels", "select room_type, room_code from room_codes");
$count=mysql_num_rows($getinfo);
$i=0;
while ($i<$count) {
list($VAR1, $VAR2)=mysql_fetch_row($getinfo);
?>
<OPTION VALUE=http://www.phpbuilder.com/board/archive/index.php/"<?echo $VAR1;?>">
<?
echo $VAR2;
}
$i++;
}
?>
</SELECT>
I have search (extensivly) on this topic, and found loads, I have tried 3 differnt pieces of code but I'm still stuck, if people could help I'd be very greatful.
Many Thanks
Ben Blackmore
I have a MySQL database with a table 'room_codes' which has 2 fields, 'room_type' and 'room_code'. I'd like to create a drop down menu that shows the room_type, but has the value of room_code. So far I have the following code but it doesn't work.
<SELECT NAME="room_type">
<?
$getinfo=mysql_query("hkihotels", "select room_type, room_code from room_codes");
$count=mysql_num_rows($getinfo);
$i=0;
while ($i<$count) {
list($VAR1, $VAR2)=mysql_fetch_row($getinfo);
?>
<OPTION VALUE=http://www.phpbuilder.com/board/archive/index.php/"<?echo $VAR1;?>">
<?
echo $VAR2;
}
$i++;
}
?>
</SELECT>
I have search (extensivly) on this topic, and found loads, I have tried 3 differnt pieces of code but I'm still stuck, if people could help I'd be very greatful.
Many Thanks
Ben Blackmore