Co potrzebuje by pobierał id wartości wysłanej do tabeli news i przekazywał go dla wartości id_newsa jak byście to zrobili ? ja myślałem o ponownym wykonaniu zapytania na te wartości i by pokazało id ale może jest prostsze rozwiązanie
<p></p> <div class="body_title">Zgłoś Newsa</div> <p></p> <div id="box"> <div class="box-top"></div> <div class="box-srodek"> <? if($_POST['addimg']){ { { $filename = $value; $filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line $add = "uploads/news/$filename"; //echo $_FILES['images']['type'][$key]; // echo "<br>"; chmod("$add",0777); $zapytanie = "INSERT INTO foto VALUES ('', '$id_newsa', '$filename')"; } } } if ($_POST['dodaj']) { $zapytanie = "INSERT INTO news VALUES ('', '$nazwa', '$autor', '$data', '$opis', '$ilosc_foto')"; print "<p><b>Dodawanie Fotografi Nowości</b></p> <p>"; $max_no_img=$ilosc_foto; // Maximum number of images value to be set here for($i=1; $i<=$max_no_img; $i++){ } print '</p> <div class="pagesPrzyciski" style="margin-left:120px; margin-top:10px;"> <input type="submit" name="addimg" class="pages" value="Wyślij" /> <input type="reset" class="pages" value="Resetuj" /> <input type="button" class="pages" onclick="java script:history.back();" name="wstecz" value="Wstecz" /> </div> </form>'; } else{ print '<p><b>Dodawanie Nowej Nowości</b></p> <div id="okno"> <form enctype="multipart/form-data" action="add_news.html" method="POST"> <p class="oknoDanePotrzebne">Podaj Potrzebne Dane:</p> <p> <table> <tr><td style="text-align:right; width:200px;" valign="top"><b>Nazwa: </b></td><td valign="top"><input type="text" name="nazwa" /></td></tr> <tr><td style="text-align:right; width:200px;" valign="top"><b>Autor: </b></td><td valign="top"><input type="text" name="autor" /></td></tr> <tr><td style="text-align:right; width:200px;" valign="top"><b>Ilość Fotek:</b></td><td valign="top"><input type="text" name="ilosc_foto" onkeyup="this.value=this.value.replace(/\D/g,'')" /></td></tr> <tr><td style="text-align:right; width:200px;" valign="top"><b>Opis: </b></td><td valign="top"><textarea name="opis"></textarea></td></tr></table> </p> <div class="pagesPrzyciski" style="margin-left:120px; margin-top:10px;"> <input type="submit" name="dodaj" class="pages" value="Wyślij" /> <input type="reset" class="pages" value="Resetuj" /> <input type="button" class="pages" onclick="java script:history.back();" name="wstecz" value="Wstecz" /> </div><input type="hidden" name="data" value="<? print date("Y-m-d"); ?>" /> </form>'; } ?> </div> </div> <div class="box-dol"></div> </div>