Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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();



83.4k
Accepted
answer

Try changing it to:

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