Display data from array within an array.

Hi. I’m still in learning php. And I’d like to ask help on how can I extract the data from an array. Whenever I use the key function, some datas where overwritten. Instead of getting 135rows I only get 114 rows. Here is the my code, please badly need your help…thanks in advance…
[php]
while($row1 = mssql_fetch_array($result1)) {
$mycount = $mycount + 1;
$boskey = $row1[“EAN11”]."^".$row1[“AUART”];
$boskey1 = $row1[“ORDNUM”]."^".$row1[“ERDAT”]."^".$row1[“KUNAG”]."^".$row1[“NAME1”]."^".$row1[“PERNR”]."^".$row1[“FKIMG”]."^".$row1[“BASEPRICE”]."^".$row1[“NETPRICE”]."^".$row1[“ZZMAXDISC”]."^".$row1[“MVGR1”]."^".$row1[“KDGRP”];
$bos[$boskey][$boskey1] = $bos[$boskey][$boskey1];

	}

		for ($i = 0; $i < count($bos); $i++) {
			$abc = key($bos);	

			$arr = explode("^",$abc);
			$ean11 = $arr[0];
			$auart = $arr[1];
	
			echo $ean11 . " - " . $auart;
			
			for ($j = 0; $j < count($bos[$abc]); $j++) { //total count of $bos[$abc] is 114.
				$xxx = key($bos[$abc]);
				$arr1 = explode("^",$xxx);

				$ordnum = $arr1[0];
				$docdate = $arr1[1];
				$customer = $arr1[2];
				$name1 = $arr1[3];
				$ae = $arr1[4];
				$qty = $arr1[5];
				$baseprice = $arr1[6];
				$netprice = $arr1[7];
				//$discount = $arr1[8];
				$booktype = $arr1[9];
				$kdgrp = $arr1[10];
				$discount = 100 - (100 * ( $netprice / $baseprice));

[/php]

This doesn’t make sense to me:

[php]$bos[$boskey][$boskey1] = $bos[$boskey][$boskey1];[/php]

Perhaps you wanted

[php]$bos[$boskey][$boskey1] = array($boskey => $boskey1);[/php]

I’m not sure

Sponsor our Newsletter | Privacy Policy | Terms of Service