$result = $mysql->callSP('STOREDPE1',$in); $arr_tmp=array(); foreach ($result['record'] as $rows) { echo "one value"; if(!empty($rows)){ echo "Two Value"; $arr_tmp[$rows['field1']] = $rows['field2']; } }
return $arr_tmp;
when i say var_dump($result)it has two values in array .But when i Execute "arr_tmp"it is returned with one value
out put of var_dump($result)
["param"]=> array(4) { ["whcode"]=> string(5) "001" ["mode"]=> string(1) "A" ["stock_type"]=> string(4) "AAA" ["process_name"]=> string(7) "AAAA" } ["record"]=> array(2) { [0]=> array(3) { ["Field1"]=> string(5) "value1" ["Field2"]=> string(1) "CCC" ["Field3"]=> string(4) "BCC" } [1]=> [0]=> array(3) { ["Field1"]=> string(5) "value1" ["Field2"]=> string(1) "CCC" ["Field3"]=> string(4) "BCC" } } }
output of var_dump (arr_tmp)
[1]=> [0]=> array(3) { ["Field1"]=> string(5) "value1" ["Field2"]=> string(1) "CCC" ["Field3"]=> string(4) "BCC" }
Both the array values seems to be same
I have the values overwriting in the array