Witam,
poraz pierwszy chciałabym użyć tablice asocjacyjna. Niestety mi cos nie wychodzi.
możecie mi pomoć i powiedzieć gdzie robie błąd?

  1. $strzmce = $_GET['strzmce'];
  2. $dostawca = $_GET['dostawca'];
  3. $id = $_GET['id'];
  4. $detal = $_GET['detal'];
  5. $hurt = $_GET['hurt'];
  6. $zakup_wspolczynnik = $_GET['zakup_wspolczynnik'];
  7. echo "<form action=index.php?z=k&m=l&strona=zmianacen method=GET>";
  8. echo "<table>";
  9. $query = "SELECT * FROM ehi_produkty where id_dostawcy='$dostawca'";
  10. if(!$result = mysql_query($query, $db_lnk)){
  11. echo('Wystapil blad: wykaz produktów<BR>');
  12. }
  13. while($row = mysql_fetch_row($result)){
  14. $row11 = "$row[11]";
  15. echo "<tr><td>$row[0] - ".$row[2];
  16. if ($row11 != '') {
  17. if ($row11 != 'A') { echo "<b>($row[11])</b>"; } }
  18. echo "</td>
  19. <td><center>".number_format($row[4], 2, ',', '')." ".$row[9]."</td>
  20. <td><center><input type=text name=detal size=5> ".$row[9]."</td>";
  21. if ($zakup_wspolczynnik == 'netto') { echo "<td><center>".number_format($row[7], 2, ',', '')." ".$row[9]."</td>"; }
  22. else { echo "<td><center>".number_format($row[8], 2, ',', '')." ".$row[9]."</td>"; }
  23. echo "<td><center><input type=text name=hurt size=5> ".$row[9]."</td></tr>";
  24. echo "<input type=hidden name=id value=$row[0]>";
  25. }
  26. echo "</table>";
  27. echo "
  28. <input type=hidden name=strzmce value=zapisz>
  29. <input type=hidden name=z value=k>
  30. <input type=hidden name=m value=l>
  31. <input type=hidden name=zakup_wspolczynnik value=$zakup_wspolczynnik>
  32. <input type=hidden name=strona value=zmianacen>
  33. <button type=submit>Dalej</button></form> ";
  34.  
  35.  
  36. if ($strzmce == 'zapisz') {
  37.  
  38.  
  39. $n = count($id);
  40. for ($i=0;$i<$n; $i++)
  41. echo $id[$i].' '. $detal[$i].' '. $hurt[$i].'<br>';
  42.