Help gan, ane mau delete data user tp kenapa gagal terus ya.
padahal tidak ada error, tp data tidak terhapus.
Tolong cek koding ane, mungkin ada yang kurang atau salah.
Spoiler for code datauser.php :
Quote:
<?php require('header.php');
include ('koneksi.php');
?>
<div>
<ul class="breadcrumb">
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="#">Data User</a>
</li>
</ul>
</div>
<div class="row">
<div class="box col-md-12">
<div class="box-inner">
<div class="box-header well" data-original-title="">
<h2><i class="glyphicon glyphicon-user"></i> Manage User</h2>
<div class="box-icon">
<!--a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a-->
<a href="#" class="btn btn-minimize btn-round btn-default"><i
class="glyphicon glyphicon-chevron-up"></i></a>
<a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a>
</div>
</div>
<div class="box-content">
<div class="alert alert-info"><a class="btn btn-warning btn-sm" href="tambah_user.php">
<i class="glyphicon glyphicon-plus "></i>
Tambah User</a>
</div>
<?php
$i = 1;
$result=mysql_query('SELECT t_user.username as Username,t_user.password as Password,t_user.nama_lengkap as NAMA_LENGKAP,t_user.telepon as Telepon_HP
from t_user;');
?>
<table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
<tr>
<th><center>No</center></th>
<th><center>Username</center></th>
<th><center>Password</center></th>
<th><center>Nama Lengkap</center></th>
<th><center>Telepon/HP</center></th>
<th><center>Keterangan</center></th>
</tr>
<tbody>
<?php
//while ($row=mysql_fetch_row($result)){
while ($row=mysql_fetch_array($result)){
?>
<tr>
<?php $hapus=$row['0'];?>
<td><center><?php echo $i; ?></center> </td>
<td><center><?php echo $row['Username']; ?></center> </td>
<td><?php echo $row['Password']; ?> </td>
<td><center><?php echo $row['NAMA_LENGKAP']; ?></center> </td>
<td><center><?php echo $row['Telepon_HP']; ?></center> </td>
<td class="center">
<a class="btn btn-info btn-sm" href="#">
<i class="glyphicon glyphicon-edit icon-white"></i>
Edit
</a>
<a class="btn btn-danger btn-sm" href="delete_user.php?hapus_user=<?php echo $row['Username']?>; ">
<i class="glyphicon glyphicon-trash icon-white"></i>
Hapus
</a>
</td>
</tr>
<?php
$i++;
}
?>
</tbody>
</table>
<!--/span-->
</div>
</div>
</div>
</div>
<?php require('footer.php'); ?>
Spoiler for code delete_user.php :
Quote:
<?php
include ('koneksi.php');
mysql_query("DELETE FROM t_user WHERE username=$_GET[hapus_user]");
?>
[script]
document.location='datauser.php'
[/script]