update table with foreign key [closed]

1

I'm trying to update a table with foreign keys, just in foreign keys I want to leave them with value NULL when doing update but I'm not getting this is my query:

$sql = 'UPDATE agenda SET id_pessoa=:id_pessoa ,id_tp_pessoa=:id_tp_pessoa ';
$sql .= 'WHERE id_agenda = :id_agenda';

$stm = $conexao->prepare($sql);
$stm->bindValue(':id_pessoa', $id_pessoa);

$stm->bindValue(':id_tp_pessoa', $id_tp_pessoa);


$stm->bindValue(':id_agenda', $id_agenda);
$retorno = $stm->execute();
    
asked by anonymous 06.09.2017 / 05:12

0 answers