Change variable in UPDATE PDO PHPERRO: PDOStatement :: execute (): SQLSTATE [HY093]

0
@$c_matricula = $_POST['numero'];
@$data_aa = $_POST['data_aa'];
@$data_ff = $_POST['data_ff'];

if(isset($data_aa)){

    @$dataa = date("Y-m-d H:i:s");

    $pdo = $dbconn->prepare("UPDATE contato SET c_data_andamento = :data_a WHERE c_matricula = :c_matricula");
    // $stmt->bindParam(':data_a', $data_a);
    // $stmt->bindParam(':c_matricula', $c_matricula);
    $pdo->execute();

// header("Location: listar_contato.php");
}

else

{

    $pdo = $dbconn->prepare("UPDATE contato SET c_data_finalizado=:data_f WHERE c_matricula = :numero");
    $pdo->execute();

I'm getting a post from another page, if that post has to execute a query by passing the current date, query .

Erro:Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in C:\xampp\htdocs\programacao\avanco_contato.php on line 34
    
asked by anonymous 15.09.2018 / 23:22

1 answer

0
@$c_id = "2";
@$c_data_andamento = date("Y-m-d H:i:s");

 $pdo = $dbconn->prepare("UPDATE contato SET c_data_andamento = :c_data_andamento WHERE c_id = :c_id");
    $pdo->bindParam(':c_data_andamento', $c_data_andamento);
    $pdo->bindParam(':c_id', $c_id);
    $pdo->execute();
    
16.09.2018 / 03:54