hi guys! can anyone help me about this problem. i want to select the desire data from a row but only the last row the will be posted not the data that i want to get. plz help me. its inside i a while loop.
else if (($from=='Cagayan De Oro' && $to=='Zamboanga' )||($from=='Zamboanga' && $to=='Cagayan De Oro')){
$dest = 500;
$fare = $nonsp*$dest;
print '<div id="sulod" align="center"><font color="maroon">The total fare is Php. <font color="red">'.$fare.'.00 </font> for '.$nonsp.' passenger/s. Please Choose Bus Below...</font></div>';
mysql_query("INSERT INTO `reservation` (
`res_id` ,
`from` ,
`to` ,
`day` ,
`date` ,
`nonsp` ,`amount`)
VALUES (
'$id', '$from', ' $to', '$txtshowDay', '$fromdate', '$nonsp','$fare'
)");
echo "<form method='POST' action='temp.php'><center><table border='1' width='900' cellpadding='2' cellspacing='2'>
<tr><td bgcolor='yellow'><font size='3'><b>Bus No.:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Bus Type:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Departure Time:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Plate No.:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Total Fare Amount:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Bus Seats:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Reserved: </b></font></td>
<td bgcolor='yellow'><font size='3'><b>Available Seat:</b></font></td>
<td bgcolor='yellow'><font size='3'><b>Select: </b></font></td></tr>";
$sql = mysql_query("SELECT * FROM cdozam")or die("error");
while($row = mysql_fetch_array($sql))
{
$busno = $row['busno'];
$bustype = $row['bustype'];
$dep = $row['departure'];
$plateno = $row['plateno'];
$seat = $row['seat'];
$res=$row['reserve'];
$avail = $seat-$res;
echo "<tr bgcolor='#EAEAEA'>
<td><font size='3'>$busno</font></td>
<td><font size='3'>$bustype</font></td>
<td><font size='3'>$dep</font></td>
<td><font size='3'>$plateno</td>
<td><font color='red' size='3'><b>Php. $fare.00</font></b></td>
<td><font size='3'><center>$seat</center></font></td>
<td><font size='3'><center>$res</center></font></td>
<td><font size='3'><center>$avail</center></font></td>
<input type='hidden' name='idres' value='$id'>
<input type='hidden' name='iddum' value='$busno'>
<input type='hidden' name='btype' value='$bustype'>
<input type='hidden' name='plateno' value='$plateno'>
<input type='hidden' name='dep' value='$dep'>
<input type='hidden' name='fare' value='$fare'>
<input type='hidden' name='seat' value='$seat'>
<input type='hidden' name='avail' value='$avail'>
<input type='hidden' name='res' value='$res'>
<td>
<input name='submit' type='image' src='Images/ReserveButton.jpg' height='30' width='80'/> </form></td>
</tr>";
}
echo "</TABLE></center>";
}