nie wiem za bardzo jak to ladnie napisac ale w skrocie,
mam taki kod (oczywiscie wyciete fragmenty najbardziej moim zdaniem istotne):
<?php $i_f=0; while ($i_f < $num_f) { echo '<option value="'.mysql_result($firmy,$i_f,"id_towary").'">'.mysql_result($firmy,$i_f,"nazwa").'</option>'; $i_f++; }; ?>
i teraz chcialbym na tej podstawie dynamicznie wypelnic 2 imputy obok, to znaczy:
<?php <input name="cena[1]" type="textbox" VALUE= "cena where id_towary = id_towary z selekta"> <input name="vat[1]" type="textbox" VALUE="vat where id_towary = id_towary z selekta"> ?>
uwagi: wszystko jest w petli, to sa tak jakby pozycje w fvat, na podstawie wypelenienia innych imputow (ilosc) bedzie liczona cena brutto, netto łącznie, łącznie cała fvat (js) tabele: towary, pozycje, fvat
ps. juz poprawilem zeby to logicznej brzmialo.
ps2:
CREATE TABLE `firmy` ( `id_firmy` int(11) NOT NULL AUTO_INCREMENT, `nip` bigint(12) NOT NULL, `nazwa` varchar(50) collate utf8_polish_ci NOT NULL, `ulica` varchar(30) collate utf8_polish_ci NOT NULL, `kod` varchar(6) collate utf8_polish_ci NOT NULL, `miasto` varchar(20) collate utf8_polish_ci NOT NULL, `regon` int(11) NOT NULL, `uwagi` text collate utf8_polish_ci NOT NULL, PRIMARY KEY (`id_firmy`) ) CREATE TABLE `fvat` ( `id_fvat` int(11) NOT NULL AUTO_INCREMENT, `id_firmy` int(11) NOT NULL, `numer` int(11) NOT NULL, `data` date NOT NULL, `uwagi` text collate utf8_polish_ci NOT NULL, PRIMARY KEY (`id_fvat`) ) CREATE TABLE `platnosci` ( `id_platnosci` int(11) NOT NULL AUTO_INCREMENT, `id_fvat` int(11) NOT NULL, `data` date NOT NULL, `netto` int(11) NOT NULL, `brutto` int(11) NOT NULL, `rozliczono` int(1) NOT NULL, PRIMARY KEY (`id_platnosci`) ) CREATE TABLE `pozycje` ( `id_pozycje` int(11) NOT NULL AUTO_INCREMENT, `id_fvat` int(11) NOT NULL, `id_towary` int(11) NOT NULL, `ilosc` int(11) NOT NULL, `rabat` int(11) NOT NULL, PRIMARY KEY (`id_pozycje`) ) CREATE TABLE `towary` ( `id_towary` int(11) NOT NULL AUTO_INCREMENT, `nazwa` char(50) collate utf8_polish_ci NOT NULL, `cena` int(11) NOT NULL, `vat` int(11) NOT NULL, PRIMARY KEY (`id_towary`) )