We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Issue While Updating Record on view

Hello Friends, I am not able update record on my view page using below code snippets:

$table = 'TlbTechnologies'; $upcountqry = $this->modelsManager->createQuery("UPDATE ".$table." SET views = views + 1 where id='".$itemid."'"); $upcountqry->execute();



98.9k
Accepted
answer

Try changing it to:

$table = 'TlbTechnologies'; $upcountqry = $this->db->execute("UPDATE ".$table." SET views = views + 1 where id='".$itemid."'");