Mutiple selection problem
Posted: Tue Jun 19, 2007 10:28 am
I have a script that outputs multiple results from a database with each record outputted with check boxes beside each record(Thats fine)..
When i select multiple records from the results which is passed on to the next page only one of the records is passed. The information being passed to the next script is the record id..
here is the script..(Any help will be appreciated) Cheers....
When i select multiple records from the results which is passed on to the next page only one of the records is passed. The information being passed to the next script is the record id..
here is the script..(Any help will be appreciated) Cheers....
Code: Select all
<?PHP include 'header.php'; ?>
<?PHP include 'opendb.php'; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/calender.css" rel="stylesheet" type="text/css">
</head>
<body>
<?PHP
$HotelRoomID = $_GET['HotelRoomID'];
$datefrom = $_GET['datefrom'];
$dateto = $_GET['dateto'];
$sql="SELECT * FROM HotelRooms WHERE HotelRoomID='$HotelRoomID'";
$ques="SELECT dbo.Hotels.HotelName FROM Hotels INNER JOIN HotelRooms ON dbo.Hotels.HotelID = dbo.HotelRooms.HotelID WHERE HotelRoomID='$HotelRoomID'";
$query="SELECT dbo.RoomAssociations.RoomAssociation FROM RoomAssociations INNER JOIN HotelRooms ON dbo.RoomAssociations.RoomAssociationID = dbo.HotelRooms.RoomAssociationID WHERE HotelRoomID='$HotelRoomID'";
$result=mssql_query($sql);
$res=mssql_query($ques);
$reso=mssql_query($query);
$count=mssql_num_rows($result);
?>
<form method=get name=f1 action='confirmmholdroom.php'>
<?php
$i=0;
while ($i < $count) {
$rows=mssql_fetch_array($result);
$row=mssql_fetch_array($res);
$rowe=mssql_fetch_array($reso);
?>
<table width="85%" border="0">
<tr>
<td width="23%"><strong>Requested from:</strong></td>
<td width="16%"><strong>Requested to:</strong></td>
<td width="16%"><strong>Hotel</strong></td>
<td width="14%"><strong>Room:</strong></td>
<td width="31%"><strong>Notes</strong></td>
</tr>
<tr>
<td><?php echo $datefrom; ?> <input type="hidden" name="$datefrom" value="<?PHP echo $datefrom; ?>">
<input type="hidden" name="HotelRoomID" value="<?PHP echo $HotelRoomID; ?>"></td>
<td><?php echo $dateto; ?> <input type="hidden" name="$dateto" value="<?PHP echo $dateto; ?>"></td>
<td><?php echo $row['HotelName']; ?> <input type="hidden" name="HotelName" value="<?PHP echo $rows['HotelName']; ?>"></td>
<td><?php echo $rows['RoomType']; ?> <input type="hidden" name="RoomType" value="<?PHP echo $rows['RoomType']; ?>"></td>
<td><?php echo $rows['Notes']; ?> <input type="hidden" name="Notes" value="<?PHP echo $rows['Notes']; ?>"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Sales consultant</td>
<td><input readonly type="text" name="UserName" value="<?php $nw = new COM("WScript.Network"); echo $nw->username; ?>"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Surname</td>
<td><input type="text" name="surname"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Forename</td>
<td><input type="text" name="forename"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Option held:</td>
<td><input readonly type="text" name="DateHeld" value="<?PHP echo date("d/m/Y"); ?>"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Hold room">
<input name="button" type="button" onClick="location.href='http://pb-sql/wintersearch.php'" value="Cancel"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?PHP
++$i;
} ?> <?php
mssql_close();
?>
</body>
</html>
<P>
<?PHP include 'footer.php'; ?>