부트 스트랩 모달 삭제 확인을 사용하여 테이블에서 행을 삭제하려고합니다. 하지만 문제는, 내가 한 행의 내 테이블을 삭제하려고하면 삭제 된 테이블이 첫 번째 행 (항상)이라는 것입니다. 왜 이런 일이 일어 났습니까? 어떤 아이디어?부트 스트랩 모달 문제 데이터 삭제
HTML (표)
<table class="table table-bordered table-hover clearfix" id="example">
<thead>
<tr>
<th>ID de Funcionário</th>
<th>Sobrenome</th>
<th>Nome</th>
<th>Cargo</th>
<th>Telefone</th>
<th class="text-center">Opção</th>
</tr>
</thead>
<tbody>
<?php
$query="SELECT * FROM employee AS E ORDER BY name";
$res = mysql_query($query);
mysql_set_charset('utf-8');
if(!$res){
echo "Erro ao executar a query";
}
else{
while($dados=mysql_fetch_array($res)){
?>
<tr>
<td><?php echo $dados['func_id']; ?></td>
<td><?php echo $dados['last_name']; ?></td>
<td><?php echo $dados['name']; ?></td>
<td><?php echo $dados['position']; ?></td>
<td><?php echo $dados['phone']; ?></td>
<td class="text-center">
<a class="btn btn-danger btn-xs" data-toggle="modal" data-target="#delete" data-whatever="@mdo">
<span class="fa fa-trash">Apagar</span>
</a>
<?php include('modal_delete.php');?>
</td>
</tr>
<?php
}}
?>
</tbody>
Modal_delete.php가는 (포함)
<div class="modal" id="delete" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-left">Apagar</h4>
</div>
<div class="modal-body text-left">
<p>Deseja apagar este registro?</p>
</div>
<div class="modal-footer">
<a href="../delete/delete_reg.php?id=<?php echo $dados['idemployee'];?>" type="button" class="btn btn-primary">Apagar</a>
<a type="button" class="btn btn-default" data-dismiss="modal">Cancelar</a>
</div>
</div>
</div>
Delete_reg.php 난 내 문제를 해결하지 않는 웹 사이트에서 찾을
<?php
require("../../conection/conection.php");
$id =$_GET["id"];
$query= "DELETE FROM employee WHERE idemployee= $id";
$delete= mysql_query($query);
if(!$delete){
echo "erro!! não foi possivel apagar dado.";
}
else{
echo"Dado removido com sucesso!";
header("Location: ../list/list_reg.php");
}?>
모든 가능한 해결책은 ... 누가 좀 도와주세요 수 있습니까? 고맙습니다!!!
는'* 기능을'mysql_로 사용하지 마십시오 그들은 있습니다 같이 사용되지 않는 (http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) – Tomanow
확인 ... 정보 주셔서 감사 드리며, 변경하겠습니다.) – Kowts