1
I am trying to update a table with foreign keys, precisely in foreign keys I want to leave them with value NULL
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();
And what is your doubt?
– Renato Junior
Why aren’t you getting it? Some mistake?
– Jorge B.
It may be that some field does not accept null in the database, thus preventing its update.
– Wictor Chaves
Sergio, your question is incomplete. What exactly happens? Error messages?
– Elias Soares
sorry delay . error was in the bank was not set NULL. my Sorry fault :(
– Sergio Silva