Hi, Thanks for the reply.
Since my last post I have changed things a bit and guess what? I am still in the dark.
I split the one table into two, thinking I could use a dynamic dependant drop down by selecting the item's code in the first drop down and just viewing the concatentated explanation for that code in the second as a way around my problem There 219 items in the table.
-
<?php require_once('../Connections/link.php'); ?>
-
<?php
-
$maxRows_roomtypes = 10;
-
$pageNum_roomtypes = 0;
-
if (isset($_GET['pageNum_roomtypes'])) {
-
$pageNum_roomtypes = $_GET['pageNum_roomtypes'];
-
}
-
$startRow_roomtypes = $pageNum_roomtypes * $maxRows_roomtypes;
-
-
mysql_select_db($database_link, $link);
-
$query_roomtypes = "SELECT * FROM roomtypes";
-
$query_limit_roomtypes = sprintf("%s LIMIT %d, %d", $query_roomtypes, $startRow_roomtypes, $maxRows_roomtypes);
-
$roomtypes = mysql_query($query_limit_roomtypes, $link) or die(mysql_error());
-
$row_roomtypes = mysql_fetch_assoc($roomtypes);
-
-
if (isset($_GET['totalRows_roomtypes'])) {
-
$totalRows_roomtypes = $_GET['totalRows_roomtypes'];
-
} else {
-
$all_roomtypes = mysql_query($query_roomtypes);
-
$totalRows_roomtypes = mysql_num_rows($all_roomtypes);
-
}
-
$totalPages_roomtypes = ceil($totalRows_roomtypes/$maxRows_roomtypes)-1;
-
-
$maxRows_roomtypecodes = 10;
-
$pageNum_roomtypecodes = 0;
-
if (isset($_GET['pageNum_roomtypecodes'])) {
-
$pageNum_roomtypecodes = $_GET['pageNum_roomtypecodes'];
-
}
-
$startRow_roomtypecodes = $pageNum_roomtypecodes * $maxRows_roomtypecodes;
-
-
mysql_select_db($database_link, $link);
-
$query_roomtypecodes = "SELECT * FROM roomtypecodes";
-
$query_limit_roomtypecodes = sprintf("%s LIMIT %d, %d", $query_roomtypecodes, $startRow_roomtypecodes, $maxRows_roomtypecodes);
-
$roomtypecodes = mysql_query($query_limit_roomtypecodes, $link) or die(mysql_error());
-
$row_roomtypecodes = mysql_fetch_assoc($roomtypecodes);
-
-
if (isset($_GET['totalRows_roomtypecodes'])) {
-
$totalRows_roomtypecodes = $_GET['totalRows_roomtypecodes'];
-
} else {
-
$all_roomtypecodes = mysql_query($query_roomtypecodes);
-
$totalRows_roomtypecodes = mysql_num_rows($all_roomtypecodes);
-
}
-
$totalPages_roomtypecodes = ceil($totalRows_roomtypecodes/$maxRows_roomtypecodes)-1;
-
?>
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<html>
-
<head>
-
<title>Untitled Document</title>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
</head>
-
-
<body>
-
<form name="form1" method="post" action="">
-
<table border="1">
-
<tr>
-
<td>roomtypecodeid</td>
-
<td>class</td>
-
<td>nobeds</td>
-
<td>bedtype</td>
-
<td>sleeps</td>
-
</tr>
-
<?php do { ?>
-
<tr>
-
<td><?php echo $row_roomtypes['roomtypecodeid']; ?></td>
-
<td><?php echo $row_roomtypes['class']; ?></td>
-
<td><?php echo $row_roomtypes['nobeds']; ?></td>
-
<td><?php echo $row_roomtypes['bedtype']; ?></td>
-
<td><?php echo $row_roomtypes['sleeps']; ?></td>
-
</tr>
-
<?php } while ($row_roomtypes = mysql_fetch_assoc($roomtypes)); ?>
-
</table>
-
<p> </p>
-
<table border="1">
-
<tr>
-
<td>id</td>
-
<td>code</td>
-
</tr>
-
<?php do { ?>
-
<tr>
-
<td><?php echo $row_roomtypecodes['id']; ?></td>
-
<td><?php echo $row_roomtypecodes['code']; ?></td>
-
</tr>
-
<?php } while ($row_roomtypecodes = mysql_fetch_assoc($roomtypecodes)); ?>
-
</table>
-
<p> </p>
-
</form>
-
</body>
-
</html>
-
<?php
-
mysql_free_result($roomtypes);
-
-
mysql_free_result($roomtypecodes);
-
?>
-
The above code is just one item I am displayiong in a much larger form to be submitted.
BAsically the user has to set up their rates to hire out rooms for and part of the process is to select a type of room to be associated with what we call a "system rate type" The COLUMN "CODE" in the second table called ROOMTYPECODES looks like this "A1D/2" and the details in the second table called ROOMTYPE(in fact the top one in the example above but they will be changed around later) are in another table which consists of the following fields
roomtypecodeid ,class, nobeds, bedtype, sleeps . All I want to do is to select the ROOMTYPE CODE from a select list and have the details associated with that code displayed to the user so they know what the code consists of like so:
A1D/2 - (field_class =Superior) (field_nobeds =1) (field_bedtype= Double and field_sleeps= 2 ) . ((Field_xxx = ))will not be visible besides the table heading so what the user sees when they click on "A1D/2" etc on the select list will be
A1D/2 - Superior Room, 1 Double Bed, Sleeps 2
Hope this all makes sense
best regards
garwil