art.y Posted May 19, 2008 Report Share Posted May 19, 2008 Varbūt kāds var pateikt kapēc nenotiek update's ? if (isset($_POST['edit'])){ if (isset($_POST['checkbox'])) { $checkbox = $_POST['checkbox']; foreach ($checkbox as $checkbox) { $sql = "UPDATE `race` SET `nosaukums`='" . $_POST['edit_nosaukums'.$checkbox] . "', ... WHERE (`race`.raceId = '$checkbox')"; mysql_query( $sql )or die ("error"); } } $a=mysql_query (SELECT ...) while ($b=mysql_fetch_array($a)) { echo '<form method="post">'; echo '<input type="checkbox" name="checkbox[]" value="'.$b['raceId'].'"/>'; echo '<textarea name="edit_nosaukums">' .$b['nosaukums']. '</textarea>'; ... echo '<input name="edit" type="submit" value="Labot" />'; Link to comment Share on other sites More sharing options...
andrisp Posted May 19, 2008 Report Share Posted May 19, 2008 (edited) Kas par kļūdu ? Līdz mysql_query() vispār tiek ? Iekš tā or die() ieliec mysql_error() nevis vienkārši "error". Edited May 19, 2008 by andrisp Link to comment Share on other sites More sharing options...
art.y Posted May 19, 2008 Author Report Share Posted May 19, 2008 errorus neizmet. Izdzēš tikai visu informāciju no laukiem un viss. Link to comment Share on other sites More sharing options...
andrisp Posted May 19, 2008 Report Share Posted May 19, 2008 Tātad $_POST['edit_nosaukums'.$checkbox] nesatur to, ko tu domā, ka tas satur. Un tā jau arī ir - tev formā ir vienkārši "edit_nosaukums" bez nekā galā. Link to comment Share on other sites More sharing options...
art.y Posted May 19, 2008 Author Report Share Posted May 19, 2008 Jā, pieliku galā -> '.$b['raceId'].' un viss aizgāja! ;) Link to comment Share on other sites More sharing options...
Recommended Posts