I have an application that takes the content of a particular site and compares if it is different from the current one comparing with the registry in the database and sends an email that had a change, besides updating in the database with the new content to be used in the next check.
The feature was working properly, but now it has stopped.
But it was not the first time that this problem occurred, I had to put a ibase_commit
to update correctly in the bank. And it has to do with the method below, since I passed a String to test directly on the method call and the record was not updated and the method is always called since I put a echo 'ok'
and returned in the CMD.
The Controller function follows:
public function update($codigo, $conteudo){
$connect = OpenConnection();
$query = ibase_query($connect, "UPDATE CAD_SITES SET CONTEUDO = ?, DATA_ENVIO_EMAIL = ?, HORA_ENVIO_EMAIL = ? WHERE CODIGO = ?", 'Teste', date('d-m-Y'), date('G:i:s'), $codigo);
$result = false;
if ($query){
$result = ibase_commit($connect);
if($result){
echo "Alterou";
} else {
echo "Não alterou";
}
}
if (ibase_errmsg()){
$result = '[ERRO] '.ibase_errmsg();
}
return $result;
}