I want to edit my database with popup model, my code like this :
<button type='button' class='btn btn-block btn-info btn-xs' data-toggle='modal' a href='#myModal' data-id= ".$rows['no']." >EDIT</td>
and those edit button refers to
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">STATUS</h4>
</div>
<form method="post" action="module/prepaid/update.php">
<input type="hidden" value="<?php echo $rows['no']; ?>" name="no">
<div class="modal-body">
<i class="fa fa-remove text-red"></i>
<input type="radio" name="status" value="Defect" <? php echo active_radio_button("Defect", $rows['status']) ?>> Defect
<i class="fa fa-refresh text-blue"></i>
<input type="radio" name="status" value="OP" <? php echo active_radio_button("On Progress", $rows['status']) ?>> On Progress
<i class="fa fa-check-circle text-green"></i>
<input type="radio" name="status" value="OK" <? php echo active_radio_button("OK", $rows['status']) ?>> OK
<div id="div1"></div>
</div>
<div class="modal-footer">
<input type="buttons" class="btn btn-default" value="SAVE" data-dismiss="modal" onclick="window.location.href='module/prepaid/update.php'" /></a>
</div>
</div>
</form>
</div>
</div>
Popup was succesfully appear but eveytime i submit my edit error appear :
Notice: Undefined index: no in C:\xampp\htdocs\ocsweb\module\prepaid\update.php on line 10
my update.php is :
<?php
$server = "localhost";
$username = "root";
$password = "";
$database = "ocsweb";
$konek = mysql_connect($server, $username, $password) or die ("Gagal konek ke server MySQL" .mysql_error());
$bukadb = mysql_select_db($database) or die ("Gagal membuka database $database" .mysql_error());
$no = $_POST['no'];
$status = $_POST['status'];
$query="UPDATE postpaid SET status = '$status' WHERE no='$no'";
mysql_query($query);
I see in here the problem is index "no" (index no or number is like id) is undifinied but I do not know where my mistakes are, please help :( Thank You..