Witam, mam taki oto skrypt php.
date_deliv.php
<?php
?>
<style type="text/css" media="all">
<!--
@import url("style.css");
-->
</style>
<div id="menu"><?php include ('menu.php') ?></div>
<div id="body">
<?php
include ('connect.php');
if ($_POST['numer'] <>'') {
$pole = $_POST['numer'];
$_SESSION['nk'] = $pole;
}
if(
$_SESSION['login'] <>''){
$nk=$_SESSION['nk'];
include('query.php');
$result = mssql_query($query15);
$count=mssql_num_rows($result);
if($count > 0) {
/* jeżeli wynik jest pozytywny, to wyświetlamy dane */
echo "<table cellpadding=\"2\" border=1>"; echo "<caption align='ustawienie'><font color='red'></caption>"; include('print_portal.php');
}
}
mssql_close($dbhandle);
include('footer.php');
?>
</div>
</form>
oraz
print_portal.php
<?php
echo "<form name='form1' method='post' action=''>"; echo "<strong>".$_SESSION['nazwa1']."</strong>"; echo "<td><strong>ID</strong></td>"; echo "<td><strong>Part number</strong></td>"; echo "<td><strong>Quantity</strong></td>"; echo "<td><strong>Planned date of delivery</strong></td>"; echo "<td><strong>Supplier code</strong></td>"; echo "<td><strong>Supplier name</strong></td>"; echo "<td><strong>Order number</strong></td>"; echo "<td><strong>Line number</strong></td>"; echo "<td><strong>Date of delivery</strong></td>"; echo "<td><strong>Quantity delivered</strong></td>";
while($r = mssql_fetch_assoc($result)) {
include('kolor.php');
echo "<tr bgcolor='$kolor'>";
echo "<td>".$id[]=$r['ID']; $r['ID']."</td>"; echo "<td>".$nrdet[] = $r['NR_DET']; $r['NR_DET']."</td>"; echo "<td>".$r['ILOSC']."</td>"; echo "<td>".$r['PLAN_DATA_DOST']."</td>"; echo "<td>".$r['KOD_DOSTAWCY']."</td>"; echo "<td>".$r['NAZ_DOSTAWCY']."</td>"; echo "<td>".$nrzam[] = $r['NR_ZAMOWIENIA']; $r['NR_ZAMOWIENIA']."</td>"; echo "<td>".$nrlin[] = $r['NR_LINII']; $r['NR_LINII']."</td>"; echo "<td><input type=text name=date_of_deliv[] value='".$r['DATA_DOST']."'/></td>"; echo "<td><input type=text name=quan_of_deliv[] value='".$r['ILOSC_DOSTAWY']."'/></td>"; }
echo "<tr><td colspan='4' align='center'><input type='submit' name='Submit' value='Submit'></td></tr>"; $count=mssql_num_rows($result);
if($Submit){
for($i=0;$i<$count;$i++){
$query22="UPDATE [PORTAL].[dbo].[IT_TEST] SET data_dostawy = '$date_of_deliv[$i]' ,ilosc_dostawy = '$quan_of_deliv[$i]' WHERE ID = '$id[$i]'";
$result22=mssql_query($query22);
}
}
// if($result22){
// header("location:date_deliv.php");
// }
?>
Niby wszystko ok.
Po wciśnięciu przycisku submit nie wywala błędów, ale nie wprowadza danych do bazy.
DLACZEGO??