Artenis Posted July 22, 2008 Report Share Posted July 22, 2008 Tātad ir viens forms un dažādi input lauku ar datubāzē vienāiem row nosaukumiem. Doma tāda: <input name="nosaukums[1] type="text"> <input type="checkbox" name="akt[1]"> <select name="pozicija[1]"><option value="1">1</option><option value=2">2</option></select> <input name="nosaukums[2] type="text"> <input type="checkbox" name="akt[2]"> <select name="pozicija[2]"><option value="1">1</option><option value=2">2</option></select> <input name="nosaukums[3] type="text"> <input type="checkbox" name="akt[3]"> <select name="pozicija[3]"><option value="1">1</option><option value=2">2</option></select> Tie inputi vēl nāks klāt utt, tā kā statiski trīs nebūs, bet doma tāda, ka kaut kā nespēju iebraukt to kā, lai ar to vienu submit pogu - UPDEITOJU konkrēās datubāzes... Iepriekš paldies. Link to comment Share on other sites More sharing options...
andrisp Posted July 22, 2008 Report Share Posted July 22, 2008 Kur īsti ir problēma ? "Nemāku noupdeito" neskaitās. Link to comment Share on other sites More sharing options...
Artenis Posted July 22, 2008 Author Report Share Posted July 22, 2008 tu mani nesaprati. ja būtu pa vienām tām sadaļām jāupdeito tad ok, nekāu problēmu. Bet tur man viena submit poga ir uz šajā piemērā 3 dažādu nosaukumu input laukiem. Kā nospiežot to pogu varu panākt ka visus tos nosaukums[1]nosaukums[2]...akt[1]akt[2]... updeitos viena tabulā, konkrētai id, kurā katrs atrodas? Ar foreach laikam nesanāks? Link to comment Share on other sites More sharing options...
andrisp Posted July 22, 2008 Report Share Posted July 22, 2008 foreach($_POST['akt'] as $item) { // daram kaut ko $_POST['pozicija'][$item] } tu mani nesaprati. e? Nebija jau ko saprast. Nebija normāli noformulēts jautājums. Link to comment Share on other sites More sharing options...
Artenis Posted July 22, 2008 Author Report Share Posted July 22, 2008 hotj bi tā! :) Link to comment Share on other sites More sharing options...
andrisp Posted July 22, 2008 Report Share Posted July 22, 2008 Artenis, un tas nozīmē ? Link to comment Share on other sites More sharing options...
Artenis Posted July 22, 2008 Author Report Share Posted July 22, 2008 (edited) neko sliktu nedomāju, tik tā nomurminaju. :) peace! foreach($_POST['nosaukums'] as $vert) { mysql_query("UPDATE $tb2 SET nosaukums='".$_POST['nosaukums'][$vert]."' WHERE id='".$_POST['id'][$vert]."' "); } Kur vaina?? Edited July 22, 2008 by Artenis Link to comment Share on other sites More sharing options...
andrisp Posted July 22, 2008 Report Share Posted July 22, 2008 Nēnu tev mana atbilde derēja vai nē ? Link to comment Share on other sites More sharing options...
Artenis Posted July 22, 2008 Author Report Share Posted July 22, 2008 Labi! mana vaina. tagad viss ok! Neieskatijos tavā piemērā. Link to comment Share on other sites More sharing options...
Recommended Posts