I am getting data from my order table in a html form, with its id under checkbox, now i want to select some id by checkbox & want to get the total quantity from the mysql table in a new html form/page. I hope, i am able to make u understand my problem.
<html>
<head>
<title>View orders details</title>
</head>
<body>
<form name="form1" action="checkboxqty.php" method="post">
<table id="tblSearch" cellpadding="2" cellspacing="0" border="0" style="width:3000px;">
<tr style="font-weight:bold;" bgcolor="#817679">
<td>#</td>
<td>Style No</td>
<td>Days To Go</td>
<td>Buying House</td>
<td>Buyer</td>
<td>Department</td>
<td>Department For</td>
<td>Shipment Date<br/><font style="color: #666666; font-size: 50%;">YYY-MM-DD</font></td>
<td>Ship Mood</td>
<td>Fabrics Booking Ref</td>
<td>Quantity</td>
</tr>
<?php
require("connect.php");
$buyh = $_POST['buyh'];
$ship_status = $_POST['ship_status'];
$c = substr("$ship_status", -1);
$query="SELECT * FROM tbl_order, tbl_buyr, tbl_fact1, tbl_ord2
WHERE buyh ='$buyh'
AND tbl_order_id=buyr_tbl_order_id
AND tbl_order_id=fact1_tbl_order_id
AND tbl_order_id=order2_tbl_order_id
AND ship_status = '$c' ORDER BY shipmentdate, buyh, buyr, artstyl_no ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?php
$i=0;
while ($i < $num) {
$f6=mysql_result($result,$i,"buyh");
$f1=mysql_result($result,$i,"buyr");
$f99=mysql_result($result,$i,"depnn");
$f12=mysql_result($result,$i,"depf");
$f7=mysql_result($result,$i,"artstyl_no");
$f2=mysql_result($result,$i,"order_no");
$shipdate=mysql_result($result,$i,"shipmentdate");
$fdate=strtotime($shipdate);
$f3=date("j-M-y", $fdate);
//$f4= date("Y-m-d");
$f4= date("F j, Y");
$start=strtotime($f4);
$end=strtotime($shipdate);
$sum=$end-$start;
$result1=floor($sum/86400);
$f5="$result1";
$f10=mysql_result($result,$i,"orderqty");
$f47=mysql_result($result,$i,"tbl_order_id");
$startw=strtotime($shipdate);
$f400g= date("Y-m-d");
$endy=strtotime($f400g);
$sume=$endy-$startw;
$result13=floor($sume/86400);
$f5e = substr("$result13", 0, 4);
$color_one = '#ffffff';
$color_two = '#ccffff';
$color = (is_int($i / 2)) ? $color_one : $color_two;
?>
<tr bgcolor="<?=$color?>" onmouseover="this.style.background='#00ccff';" onmouseout="this.style.background='';" onClick="HighLightTR(this,'#c9244a','cc3333');">
<td><input name="id[<?php echo $rows['tbl_order_id']; ?>]" type="checkbox" value="<?php echo $rows['tbl_order_id']; ?>"></td>
<td style="background-color:#FFF;">
<span class="class3">
<a href="ddupdateano.php?tbl_order_id=<?php echo $f47; ?>" target="_blank"><?php echo $f7; ?></a>
</span>
</td>
<?php
if($f5>60) {
// Display RED
?>
<td valign="middle" style="background-color:#0F0;"><?php echo $f5; ?></td>
<?php
} elseif($f5>30 && $f5<61) {
// Display YELLOW
?>
<td valign="middle" style="background-color:#FF0;"><?php echo $f5; ?></td>
<?php
} elseif($f5<0) {
// Display YELLOW
?>
<td valign="middle" style="background-color:#0FF;"><?php echo "Expire"; ?><sup><span class="preppy4"><?php echo $f5e; ?></span></sup></td>
<?php
}else {
?>
<td valign="middle" style="background-color:#F00;"><?php echo $f5; ?></td>
<?php
}
?>
<td><?php echo $f6; ?></td>
<td><?php echo $f1; ?></td>
<td><?php echo $f99; ?></td>
<td><?php echo $f12; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f216; ?></td>
<td><?php echo $f6; ?> <?php echo $f15; ?></td>
<td><?php echo $f10; ?></td>
</tr>
<?php
$i++;
}
?>
<tr style="font-weight:bold;" bgcolor="#817679">
<td colspan="35"></td>
</tr>
<tr>
<td colspan="16" align="center">
<input name="delete" type="submit" value="Submit">
</td>
</tr>
</table>
</form>
</br>
</body>
</html>
Please help me to create checkboxqty.php to get the selected rows total quantity from DB.