1
I have an administrative panel and in the page to edit the user I receive the data by the form and do the update in the table so that always returns the message from
Notice error: Trying to get Property of non-object in C: wamp64 www sondplay admin processa proc_edit_usuario.php on line 25
in my if
i check if there has been any change in the lines and if there is displays the message that the user has been modified and redirects to the user list page and otherwise displays the message that the user has not successfully edited the error think this in the rowCount
my code
<?php
session_start();
include_once("../seguranca.php");
include_once("../conexao.php");
$id = $_POST["id"];
$nome = $_POST["nome"];
$email = $_POST["email"];
$usuario = $_POST["usuario"];
$senha = $_POST["senha"];
$nivel_de_acesso = $_POST["nivel_de_acesso"];
/* Delete all rows from the FRUIT table */
$del = $pdo->prepare("UPDATE usuarios set nome ='$nome', email = '$email', login = '$usuario', senha = '$senha', nivel_acesso_id = '$nivel_de_acesso', modified = NOW() WHERE id='$id'");
$del->execute();
$count = $del->rowCount();
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
</head>
<body>
<?php
if ($count->rowCount > 0) {
echo "
<META HTTP-EQUIV=REFRESH CONTENT = '0;URL=../administrativo.php?link=2'>
<script type=\"text/javascript\">
alert(\"Usuário editado com Sucesso.\");
</script>
";
} else {
echo "
<script type=\"text/javascript\">
alert(\"Usuário não foi editado com Sucesso.\");
</script>
";
}
?>
</body>
</html>
now I understood gave straight thanks for the help
– diogo Dsa