Hi,

I want to clear or delete old values of array
I attached my database dump with this post
my code is

require_once('includes/DbConnector.php');
require_once('includes/Validator.php');
require_once('includes/CommonUtility.php');
$z=0;
$duplicateFlag=false;
$qury="SELECT orders.order_id,users.company,users.minorderamt,vendororder.vendid   
	   FROM orders 
	   LEFT JOIN vendororder ON  vendororder.orderid=orders.order_id
	   LEFT JOIN users ON  users.user_id=vendororder.vendid  
	   WHERE orders.status='C' AND orders.order_id='368'
	   ORDER BY vendororder.vendid";   
$qryR1=$connector->query($qury); 
while($rsV=$connector->fetchArray($qryR1)){
$total=0; 
$minAmt[]=$rsV['minorderamt'];
$l=0;
 
echo '<TABLE width="100%"  border=0 align=center cellPadding=3 cellSpacing=1 bgColor="#EAEAEA">
	  <TBODY>
	   <TR bgcolor="#FFFFFF">  
		<TD align=left height="55px" colspan=4  class="text13">'.($z+1).' )&nbsp;&nbsp;<B>Vendor:&nbsp;&nbsp;&nbsp;&nbsp;'.$rsV['company'].'</B> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Min Order Amount:<B>&nbsp;$&nbsp;'.sprintf("%1.2f",$rsV['minorderamt']).'</B></TD> 
	  </TR> 
	  <TR bgcolor="#FFFFFF">  
		<TD align=center height="35px"  class="text13"><B>Product</B></TD><TD align=center  height="35px" class="text13"><B>Quantity</B></TD>
		<TD align=center height="35px"  class="text13"><B>Bid Price</B></TD><TD align=center  height="35px" class="text13"><B>Total Amount( $ )</B></TD>
	  </TR>';
         $qry="SELECT bids.bid_id,vendid,orderid,bidamount,status,biddetails.pid,biddetails.qty,biddetails.bidprice,bidprice,product.item_desc,product.product_id
	           FROM biddetails 
			   LEFT JOIN product ON  product.product_id=biddetails.pid
			   LEFT JOIN bids ON  bids.bid_id=biddetails.bid_id 
			   WHERE bids.orderid='".$rsV['order_id']."' AND bids.vendid='".$rsV['vendid']."'  GROUP BY product.product_id 
			   ORDER BY bids.orderid";   
		$qryRslt=$connector->query($qry); echo "<BR> TOTCOUUNT".$numrow=$connector->fnGetNumRows($qryRslt);
		$pp=0;
		while($rs_B=$connector->fetchArray($qryRslt)){
				echo '<TR bgcolor="#FFFFFF">  
						<TD align=center height="35px"  class="text13">'.$rs_B['item_desc'].'</TD><TD align=center  height="35px" class="text13">'.$rs_B['qty'].'</TD>
						<TD align=center height="35px"  class="text13">'.$rs_B['bidprice'].'</TD><TD align=center  height="35px" class="text13">'.(sprintf("%1.2f",$rs_B['bidprice']*$rs_B['qty'])).'</TD>
					  </TR>';

//Here i added all total and vendor id  in array  $indTot[] and  $indVid[] respectively					
			
			  $total=$total+($rs_B['bidprice']*$rs_B['qty']);	 //echo  $rs_B['bidprice']*$rs_B['qty']."<BR>";
			  $indTot[]=($rs_B['bidprice']*$rs_B['qty']);
			  $indVid[]=$rs_B['vendid'];  
			  $indPid[]=$rs_B['product_id'];
			  //array_push($ttarr,$rs_B['bidprice']*$rs_B['qty']);
			 
				  if($z==0)
				  {
					
						   /* $qry="SELECT f_id FROM finaltest WHERE pid='".$rs_B['product_id']."' AND vid='".$rs_B['vendid']."' AND bidid='".$rs_B['bid_id']."' ";   
							$sResult=$connector->query($qry); 
							if($connector->fnGetNumRows($sResult)==0){
								if($rs_M=$connector->fetchArray($sResult)) $f_id=$rs_M['f_id'];  
									$sZql ="INSERT INTO finaltest (pid,vid,bamt,bidid) VALUES ('".$rs_B['product_id']."','".$rs_B['vendid']."','".($rs_B['bidprice']*$rs_B['qty'])."','".$rs_B['bid_id']."')"; 
									$qExec=$connector->query($sZql);
						}  */
				   } 
//Here i am created two combination of that arrays
			
				$pp++; echo $pp."row".$numrow;
				if($pp==$numrow)
				{
					for($i=0;$i<$numrow-1;++$i)
					{ 
					   for($j=$i+1;$j<$numrow;++$j)
					   {
										//  echo $indTot[$p][$i]." + ".$indTot[$p][$j].'<BR>';
									   $vendTwoComb[]=$indTot[$i]+$indTot[$j];
									   $vendTwoCombAmt[]=$indTot[$i]."+".$indTot[$j];  
									   $vendTwoCombVids[]=$indVid[$i]."+".$indVid[$j];  
									   $vendTwoCombPids[]=$indPid[$i]."+".$indPid[$j]; 
									   //echo $indPid[$p][$i]." + ".$indPid[$p][$j].'<BR>';
					   }
					}
					
				  print_r($vendTwoComb); echo count($vendTwoComb);
				echo "----".$jj=count($vendTwoComb);

// I want to delete or clear all values of array here 					
					for($x=0;$x<$jj;$jj--)			
					{
					unset($indTot[$x]); 
					unset($indVid[$x]); 
					unset($indPid[$x]); 
					$x++;
				    }
			    }
						

			 $l++;
		}
		$tamts[]=$total;
		
		echo '<TR bgcolor="#FFFFFF">  
			 <TD align=center height="35px" class="text13"><B>Total Bid Amount</B></TD><TD align=left colspan=3  height="35px" class="text13"> $ <B>'.sprintf("%1.2f",$total).'</B></TD>
		     </TR>';	
$z++;		
}

Please give me suggestion to how to do this??

Attachments
CREATE TABLE `biddetails` (
  `detail_id` bigint(11) NOT NULL auto_increment,
  `bid_id` int(11) NOT NULL,
  `pid` int(11) NOT NULL,
  `bidprice` double(10,2) NOT NULL default '0.00',
  `qty` int(11) NOT NULL,
  `winstatus` enum('W','L','U') NOT NULL default 'U',
  PRIMARY KEY  (`detail_id`)
) ENGINE=MyISAM AUTO_INCREMENT=913 DEFAULT CHARSET=latin1;

INSERT INTO biddetails VALUES("335","130","374","250.00","2","U");
INSERT INTO biddetails VALUES("336","130","374","250.00","2","U");
INSERT INTO biddetails VALUES("337","131","372","210.00","3","U");
INSERT INTO biddetails VALUES("338","131","374","234.00","4","U");
INSERT INTO biddetails VALUES("339","132","374","234.00","4","U");
INSERT INTO biddetails VALUES("340","132","374","234.00","4","U");
INSERT INTO biddetails VALUES("341","133","372","33.00","1","U");
INSERT INTO biddetails VALUES("342","133","374","23.00","2","U");
INSERT INTO biddetails VALUES("343","134","372","313.00","1","U");
INSERT INTO biddetails VALUES("344","134","374","213.00","2","U");
INSERT INTO biddetails VALUES("345","135","430","29.50","19","U");
INSERT INTO biddetails VALUES("346","135","431","18.63","20","U");
INSERT INTO biddetails VALUES("347","135","432","33.50","5","U");
INSERT INTO biddetails VALUES("348","135","433","80.22","6","U");
INSERT INTO biddetails VALUES("349","135","434","9.99","10","U");
INSERT INTO biddetails VALUES("350","135","435","15.99","3","U");
INSERT INTO biddetails VALUES("351","0","375","100.00","0","U");
INSERT INTO biddetails VALUES("352","0","376","87.00","0","U");
INSERT INTO biddetails VALUES("353","0","377","87.00","0","U");
INSERT INTO biddetails VALUES("354","0","379","87.00","0","U");
INSERT INTO biddetails VALUES("355","0","408","8.00","0","U");
INSERT INTO biddetails VALUES("356","0","412","7.00","0","U");
INSERT INTO biddetails VALUES("357","0","415","6.00","0","U");
INSERT INTO biddetails VALUES("358","137","375","10.00","10","U");
INSERT INTO biddetails VALUES("359","137","376","15.00","5","U");
INSERT INTO biddetails VALUES("360","137","377","45.00","4","U");
INSERT INTO biddetails VALUES("361","137","378","56.00","10","U");
INSERT INTO biddetails VALUES("362","137","379","45.00","6","U");
INSERT INTO biddetails VALUES("363","137","386","45.00","10","U");
INSERT INTO biddetails VALUES("364","137","387","7.00","14","U");
INSERT INTO biddetails VALUES("365","137","388","50.00","5","U");
INSERT INTO biddetails VALUES("366","137","389","20.00","12","U");
INSERT INTO biddetails VALUES("367","137","390","20.00","7","U");
INSERT INTO biddetails VALUES("368","137","391","40.00","8","U");
INSERT INTO biddetails VALUES("369","137","392","10.00","12","U");
INSERT INTO biddetails VALUES("370","137","393","70.00","5","U");
INSERT INTO biddetails VALUES("371","137","394","80.00","6","U");
INSERT INTO biddetails VALUES("372","137","395","10.00","15","U");
INSERT INTO biddetails VALUES("373","137","396","20.00","4","U");
INSERT INTO biddetails VALUES("374","137","397","15.00","3","U");
INSERT INTO biddetails VALUES("375","137","398","45.00","20","U");
INSERT INTO biddetails VALUES("376","137","399","40.00","6","U");
INSERT INTO biddetails VALUES("377","137","400","10.00","12","U");
INSERT INTO biddetails VALUES("378","138","375","13.00","10","U");
INSERT INTO biddetails VALUES("379","138","376","20.00","5","U");
INSERT INTO biddetails VALUES("380","138","377","49.00","4","U");
INSERT INTO biddetails VALUES("381","138","378","60.00","10","U");
INSERT INTO biddetails VALUES("382","138","379","40.00","6","U");
INSERT INTO biddetails VALUES("383","138","386","39.00","10","U");
INSERT INTO biddetails VALUES("384","138","387","15.00","14","U");
INSERT INTO biddetails VALUES("385","138","388","52.00","5","U");
INSERT INTO biddetails VALUES("386","138","389","18.00","12","U");
INSERT INTO biddetails VALUES("387","138","390","23.00","7","U");
INSERT INTO biddetails VALUES("388","138","391","46.00","8","U");
INSERT INTO biddetails VALUES("389","138","392","8.00","12","U");
INSERT INTO biddetails VALUES("390","138","393","60.00","5","U");
INSERT INTO biddetails VALUES("391","138","394","78.00","6","U");
INSERT INTO biddetails VALUES("392","138","395","17.00","15","U");
INSERT INTO biddetails VALUES("393","138","396","25.00","4","U");
INSERT INTO biddetails VALUES("394","138","397","18.00","3","U");
INSERT INTO biddetails VALUES("395","138","398","40.00","20","U");
INSERT INTO biddetails VALUES("396","138","399","38.00","6","U");
INSERT INTO biddetails VALUES("397","138","400","9.00","12","U");
INSERT INTO biddetails VALUES("398","139","372","10.00","10","U");
INSERT INTO biddetails VALUES("399","139","374","15.00","5","U");
INSERT INTO biddetails VALUES("400","139","450","25.00","8","U");
INSERT INTO biddetails VALUES("401","139","451","15.00","12","U");
INSERT INTO biddetails VALUES("402","139","452","8.00","20","U");
INSERT INTO biddetails VALUES("403","139","453","25.00","10","U");
INSERT INTO biddetails VALUES("404","139","454","30.00","8","U");
INSERT INTO biddetails VALUES("405","139","455","50.00","6","U");
INSERT INTO biddetails VALUES("406","139","456","12.00","4","U");
INSERT INTO biddetails VALUES("407","140","372","12.00","10","U");
INSERT INTO biddetails VALUES("408","140","374","18.00","5","U");
INSERT INTO biddetails VALUES("409","140","450","22.00","8","U");
INSERT INTO biddetails VALUES("410","140","451","17.00","12","U");
INSERT INTO biddetails VALUES("411","140","452","7.00","20","U");
INSERT INTO biddetails VALUES("412","140","453","22.00","10","U");
INSERT INTO biddetails VALUES("413","140","454","25.00","8","U");
INSERT INTO biddetails VALUES("414","140","455","60.00","6","U");
INSERT INTO biddetails VALUES("415","140","456","15.00","4","U");
INSERT INTO biddetails VALUES("416","141","372","14.00","10","U");
INSERT INTO biddetails VALUES("417","141","374","15.00","5","U");
INSERT INTO biddetails VALUES("418","141","450","22.00","8","U");
INSERT INTO biddetails VALUES("419","141","451","40.00","12","U");
INSERT INTO biddetails VALUES("420","141","452","24.00","20","U");
INSERT INTO biddetails VALUES("421","141","453","25.00","10","U");
INSERT INTO biddetails VALUES("422","141","454","15.00","8","U");
INSERT INTO biddetails VALUES("423","141","455","55.00","6","U");
INSERT INTO biddetails VALUES("424","141","456","14.00","4","U");
INSERT INTO biddetails VALUES("425","142","372","12.00","10","U");
INSERT INTO biddetails VALUES("426","142","374","17.00","5","U");
INSERT INTO biddetails VALUES("427","142","450","20.00","8","U");
INSERT INTO biddetails VALUES("428","142","451","20.00","12","U");
INSERT INTO biddetails VALUES("429","142","452","10.00","20","U");
INSERT INTO biddetails VALUES("430","142","453","30.00","10","U");
INSERT INTO biddetails VALUES("431","142","454","25.00","8","U");
INSERT INTO biddetails VALUES("432","142","455","60.00","6","U");
INSERT INTO biddetails VALUES("433","142","456","15.00","4","U");
INSERT INTO biddetails VALUES("434","143","372","20.00","10","U");
INSERT INTO biddetails VALUES("435","143","374","14.00","5","U");
INSERT INTO biddetails VALUES("436","143","450","19.00","8","U");
INSERT INTO biddetails VALUES("437","143","451","10.00","12","U");
INSERT INTO biddetails VALUES("438","143","452","28.00","20","U");
INSERT INTO biddetails VALUES("439","143","453","35.00","10","U");
INSERT INTO biddetails VALUES("440","143","454","27.00","8","U");
INSERT INTO biddetails VALUES("441","143","455","51.00","6","U");
INSERT INTO biddetails VALUES("442","143","456","13.00","4","U");
INSERT INTO biddetails VALUES("443","144","375","10.00","12","U");
INSERT INTO biddetails VALUES("444","144","376","20.00","45","U");
INSERT INTO biddetails VALUES("445","144","377","30.00","7","U");
INSERT INTO biddetails VALUES("446","144","378","40.00","45","U");
INSERT INTO biddetails VALUES("447","144","379","50.00","89","U");
INSERT INTO biddetails VALUES("448","144","386","60.00","8","U");
INSERT INTO biddetails VALUES("449","144","387","12.00","78","U");
INSERT INTO biddetails VALUES("450","144","388","23.00","78","U");
INSERT INTO biddetails VALUES("451","144","389","45.00","56","U");
INSERT INTO biddetails VALUES("452","144","390","62.00","45","U");
INSERT INTO biddetails VALUES("453","144","391","53.00","65","U");
INSERT INTO biddetails VALUES("454","144","392","41.00","11","U");
INSERT INTO biddetails VALUES("455","144","393","52.00","12","U");
INSERT INTO biddetails VALUES("456","144","394","63.00","20","U");
INSERT INTO biddetails VALUES("457","144","395","52.00","50","U");
INSERT INTO biddetails VALUES("458","144","396","12.00","70","U");
INSERT INTO biddetails VALUES("459","144","397","23.00","77","U");
INSERT INTO biddetails VALUES("460","144","398","24.00","12","U");
INSERT INTO biddetails VALUES("461","144","399","26.00","45","U");
INSERT INTO biddetails VALUES("462","144","400","25.00","45","U");
INSERT INTO biddetails VALUES("463","144","401","10.00","20","U");
INSERT INTO biddetails VALUES("464","144","402","30.00","15","U");
INSERT INTO biddetails VALUES("465","144","403","52.00","10","U");
INSERT INTO biddetails VALUES("466","144","404","45.00","35","U");
INSERT INTO biddetails VALUES("467","144","405","62.00","54","U");
INSERT INTO biddetails VALUES("468","144","406","30.00","25","U");
INSERT INTO biddetails VALUES("469","144","407","12.00","15","U");
INSERT INTO biddetails VALUES("470","144","408","10.00","65","U");
INSERT INTO biddetails VALUES("471","144","409","25.00","48","U");
INSERT INTO biddetails VALUES("472","144","410","34.00","32","U");
INSERT INTO biddetails VALUES("473","144","411","42.00","45","U");
INSERT INTO biddetails VALUES("474","144","412","52.00","12","U");
INSERT INTO biddetails VALUES("475","144","413","20.00","10","U");
INSERT INTO biddetails VALUES("476","144","414","12.00","40","U");
INSERT INTO biddetails VALUES("477","144","415","32.00","30","U");
INSERT INTO biddetails VALUES("478","144","416","42.00","50","U");
INSERT INTO biddetails VALUES("479","144","417","62.00","14","U");
INSERT INTO biddetails VALUES("480","144","418","52.00","25","U");
INSERT INTO biddetails VALUES("4
This question has already been answered. Start a new discussion instead.