2
I’m having trouble with a little code with delete button.
I’ve tried a few ways but I couldn’t get the button to $deletar
do the delete function.
Follows code show each registered slide and wanted to delete button.
<?php
$sql = mysql_query("SELECT * FROM slider");
while($linha = mysql_fetch_array($sql)){
$id = $linha['id'];
$imagem = $linha['imagem'];
$comentario = $linha['comentario'];
$link = $linha['link'];
?>
<tr>
<td><img src="pages/<?= $imagem ?>" width="150px" height="100px"></td>
<td class="mailbox-name">
<?= $comentario ?>
</td>
<td class="mailbox-subject">
<?= $link ?>
</td>
<td class="mailbox-date">
<input type="button" class="btn btn-danger" src="<?= $deletar ?>" value="Excluir">
</td>
</tr>
<?php } ?>
You’re missing an echo there, <? echo $delete ?>
– Bsalvo
Why
src="<?= $deletar ?>"
? Instead of you wearinginput
you can use the<a href="#" class="btn btn-danger" onclick="chamaDeletar(".<?php echo $deletar; ?>.")"> Excluir</a>
– adventistaam