mam taki kod:
<?php require ('sess.php'); include ('start.html'); include ('connect.php'); include ('query.php'); // echo "Dane: "; // print_r($_POST); // $count=count($_POST[data]); // echo "Licznik:".$count; // for($i=0;$i<$count;$i++){ // if($_POST[data][$i]<>''){ // echo "<br>Wartość :".$_POST[data][$i]; // } // } $w=0; $temp=0; $result111 = mssql_query($query15); while($p = mssql_fetch_assoc($result111)) { $ida = $p['ID']; if($ida == $_POST[data][$w]){ $w++; if($temp<>0){ if($temp<>$p['NR_DET']){ include ('footer.html'); exit; } } $temp=$p['NR_DET']; } } $result15 = mssql_query($query15); $t=0; while($r = mssql_fetch_assoc($result15)) { $id = $r['ID']; if($id == $_POST[data][$t]){ $t++; include('kolor.php'); $gti=$r['ID']; $pack_slip=$_POST['pack_slip']; $boxes=$_POST['boxes']; $box_weight=$_POST['box_weight']; if($pack_slip!=$r['PACKING_SLIP'] or $boxes!=$r['BOXES'] or $box_weight!=$r['BOX_WEIGHT']){ $query22="UPDATE [PORTAL].[dbo].[IT_TEST] SET packing_slip = '$pack_slip' ,boxes = '$boxes', box_weight = '$box_weight' WHERE ID = '$gti'"; $result22=mssql_query($query22); } } $ps++; } mssql_close($dbhandle); include ('footer.html'); ?>
Do tego pliku przekazuję zmienne w tablicy data metodą POST.
Jednak gdy zrobię refresh (F5) to wszystko znika - zmienne się kasują. Jak zapisać je na stałe, aby się nie kasowały?
Jest jeszcze kwestia tego, że nie działa zapisywanie wartości do SQL poprzez Update - nie wiem co tam jest nie tak.
Jeśli macie jakieś pomysły to pomoc mile widziana.