untuk scriptnya liat di bawah ini --------------------------------------------------------------------------------- <form action="" method="POST"> <div class="table-responsive"> <table class="table table-bordered table-hover"> <tr> <th>Nama</th> <th>Tempat Tanggal Lahir</th> <th>Jenis Kelamin</th> <th>Alamat</th> <th>Pekerjaan</th> <th>No handphone</th> <th>block</th> <th>action</th> </tr> <?php $sql_pelapor = mysql_query("SELECT * FROM pelapor"); while ($data = mysql_fetch_assoc($sql_pelapor)) { ?> <tr> <td><?php echo $data['nama']; ?></td> <td><?php echo $data['tempat_lahir'].", ". $data['tgl_lahir']. " " . $data['bulan_lahir']. " " .$data['tahun_lahir']; ?></td> <td><?php echo $data['jk']; ?></td> <td><?php echo $data['alamat']; ?></td> <td><?php echo $data['pekerjaan']; ?></td> <td><?php echo $data['nohp']; ?></td> <td> <select name="block"> <option value="Y" <?php if($data['block'] == "Y") { echo "selected";} ?>>Yes</option> <option value="N" <?php if($data['block'] == "N") { echo "selected";} ?>>No</option> </select> </td> <td> <input type="hidden" name="id" value="<?php echo $data['np']; ?>"> <input type="submit" name="edit" value="Save" class="btn btn-success btn-sm"> </td> </tr> <?php } $block = $_POST['block']; $edit = $_POST['edit']; $id = $_POST['id']; if($edit) { mysql_query("UPDATE pelapor SET block='$block' WHERE np ='$id'") or die(mysql_error()); } ?> </table> </div> </form> ----------------------------------------------------------- ada yang salah atau kurang?
0 jempol