I have a table that lists records in the database and in front of each record has a button like that
<a href="index.php?mod=pedidos&funcao=editar&id=<?=$lnped['protocolo']?>" class="ls-btn-primary ls-ico-user"></a>
$lnped['protocolo']
comes from the database is the registry number
here's my code
<?php
$idget = isset($_GET['id']) ? $_GET['id'] : '';
$produzir = isset($_GET['funcao']) ? $_GET['funcao'] : '';
$consultapedidos = mysql_query("SELECT * FROM pedidos WHERE protocolo = '".$idget."'");
if(mysql_num_rows($consultapedidos)==true){
if($produzir == "editar"){
$sql = mysql_query("UPDATE pedidos SET produzido = '1'") ;
echo "<meta http-equiv='refresh' content='1;' URL= index.php?mod=pedidos>";
}
}
?>