In my scripting i am defining a associative array which get data from number array with a for loop also in my end of scriting i empty this array and first time it work fine when first time form open with general date but when i submit this form on these same dates it give as increasing the value only which i produce from this array i explain my scripting
// defining array
define("units","units");
define("customer","customer");
define("speciecode","speciecode");
$slproj = array (
array ( units=>"",
customer=>"",
speciecode=>"")
);
// now getting data with for loop for this array and add these
// records with array_push
for($zzz=0;$zzz < count($temp); $zzz++)
{
$temp3=explode("",$temp[$zzz]);
$units[]=$temp3[0];
$Customer[]=$temp3[1];
$speciecode[]=$temp3[2];
//print "<p><b>UNITS</b>".$units[$zzz]."><p>";
//print "<b>CUSTOMER</b>".$Customer[$zzz]."<p>";
//print "<b>SPECIECODE</b>".$speciecode[$zzz]."<p>";
$row = array (units=>$temp3[0],
customer=>$temp3[1],
speciecode=>$temp3[2] );
array_push($slproj, $row);
}
// during in my scriptin i use this array using this foreach loop
$spcode=$row["speciecode"];
//print "<b>The SpecieCode : </b>".$spcode."<br>";
foreach ( $slproj as $val )
{
if($val[speciecode]==$spcode){
// continue scripting Note here is problem produce when i submit
// the form second time first time these result or ok
// in my end i empty this array like this
foreach ( $slproj as $val ){
$val[units] = "";
$val[customer] = "";
$val[speciecode] = "";
}
//$slproj="";
//-----------------------------------------------------------------//
first time when i get a result like this only one record show here
AHI SASH #2+
Actual 100.30
Budget 195
Second time when i get a result as submitting this form same values ONLY on Sbmitting
AHI SASH #2+
Actual 100.30
Budget 6665
see the Budget value change and this value which i am getting from array