0
I have a js script to delete sql results with PHP and JS...
LINK
<a href="javascript:;" onClick="deletar(<?php echo $exibe['matricula']; ?>);">
JS
function deletar(matricula) {
if (confirm("Tem certeza que deseja apagar?")) {
$.ajax({
type: "GET",
url: "index.php?pg=associados",
data: "&acao=deletar&matricula=" + matricula,
success: function() {
location.href = 'associados';
}
});
} else {
return false
}
}
PHP
if($_GET['acao'] == "deletar"){
$deletar = mysqli_query($conecta, "DELETE FROM socios WHERE matricula='".$_GET['matricula']."'");
}
What is happening is the following, the column "matricula" it is INT(5) so that the numbers are displayed in 5 numbers (00001). Until then the code works well, but when I try to erase results above 00010 they do not erase.
Someone to help me?
Number started with zero is octal, you should send the number without zeros if you need to format from a padding (add zeros to the left).
– rray
What do you mean, Everson, I don’t understand you
– Nicholas Ruschel Krüger
Didn’t solve little brother
– Nicholas Ruschel Krüger