У меня есть список с информацией из базы данных, рядом с каждой записью есть кнопка для редактирования данных записи.Проблема в том, что когда я пытаюсь отправить идентификатор реестра, который я хочу изменить, я всегда получаю один и тот же вывод, простое слово: Array.
Это таблица:
<th><?php echo $row_usuario["id_employee"]; ?></th>
<td><?php echo $row_usuario["nome"]; ?></td>
<td><?php echo $row_usuario["email"]; ?></td>
<td>
<a href="#Edit" id="custId" data-toggle="modal" data-id=" '.$row_usuario['id_employee'].'">
<i class="material-icons" style="color:#2A6F46">edit</i>
</a>
</td>
Аякс:
$(document).ready(function(){
$('#Edit').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'list_emp.php',
data : 'rowid='+ rowid,
success : function(data){
$('.fetched-data').html(data);//Show fetched data from database
}
});
});
});
Часть запроса:
//database connection include before this
if($_POST['rowid']) {
$id = $_POST['rowid'];
//here is the problem, i'm not receiving the real id, just the word "Array" and i can't run the query because this
}
Модальный:
<div class="fetched-data">Here i want to show the form with the info to be edit</div>
Может кто-нибудь помочь мне найти ошибку?