I couldn’t find the error

Asked

Viewed 40 times

-3

Uncaught Error: Function name must be a string in /Storage/ssd4/127/9971127/public_html/delete.php:6 Stack trace: #0 {main} thrown in /Storage/ssd4/127/9971127/public_html/delete.php on line 6

<?php

include_once('CONEXAO.php');

$CONEXAO = new CONEXAO();
$ID = $_POST('ID');

$smtp = $CONEXAO->conn->prepare('DELETE FROM USUARIO WHERE ID = :ID');
$smtp->execute(array('ID' => $ID));

if($smtp){
    echo 'excluido com sucesso';
}else{
    echo 'item invalido';
}
?>

1 answer

1

$_POST is a global variable (array) and these are called in function form.. try like this:

$ID = $_POST['ID'];
  • thanks nor realized kkkkkk was worth

Browser other questions tagged

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