Problem giving update in a php table with no return

Asked

Viewed 35 times

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';
}
?>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.