0
I have no return on the page when I click on the input with name['edit'] even with Try catch, the page does not print anything, so I do not know what to do right, I wanted to know what I’m doing wrong, all variables like $name and $email are being updated, in fact the only return I have are the variables I used echo to see if they were actually being updated and are
<?php
include './conexao.php';
$editando= filter_input_array(INPUT_POST, FILTER_DEFAULT);
if(isset($editando['editar'])){
echo $id = $editando['idEditar'];
echo $nome = $editando['nomeEditar'];
echo $email = $editando['emailEditar'];
echo $site = $editando['siteEditar'];
echo $data = $editando['dataEditar'];
echo $telefone = $editando['telefoneEditar'];
echo $cidade = $editando['cidadeEditar'];
echo $estado = $editando['estadoEditar'];
$update_Query = "UPDATE cliente_tb SET nomeCliente = '".$nome."', emailCliente ='".$email."', siteCliente = '".$site."', dataContratacao = '".$data."', telefone = '$".$telefone."', cidadeCliente ='".$cidade."', estadoCliente = '".$estado."' WHERE id = '".$id."' ";
try{
$update_Result = mysqli_query($conn, $update_Query);
if($update_Result){
if(mysqli_affected_rows($conn) > 0)
{
echo 'Dados Atualizados';
}else{
echo 'Dados não foram atualizados';
}
}else{
echo 'Nao entrou no update result';
}
} catch (Exception $ex) {
echo 'Error Update '.$ex->getMessage();
}
}else{
echo 'Não está entrando no isset';
}
?>
See here how to display error while query with mysqli
– Bacco
Thank you! was very helpful
– Reynnan Viktor
Using the link that Bacco sent me in the comments I was able to resolve seeing the query error! Thanks
– Reynnan Viktor
I closed as duplicate to organize, any questions leave a comment here.
– Bacco