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

Query\Builder::update() not working Phalcon Ver 1.3.4

I am using Phalcon version 1.3.4, I tried to run an Update query using PHQL createBuilder. I getting an error message as follow : "Call to undefined method Phalcon\Mvc\Model\Query\Builder::update()"

while running this query:

   $result = $this->getModelsManager()->createBuilder()
        ->update('media', array('media_id' => $videoid))
        ->where('id = :id:', array('id' => $videoid))
        ->getQuery()
        ->execute();

Here is my sql statement I want to implement:

"UPDATE media SET media_id = $videoid WHERE id = $videoid"

am I missing something?

Where did you see that method "update"?



1.9k

Actually, I am creating all of my sql queries using PHQL Builder. I wanted to do create my update queries using same structure, and for update I found some hints from this link:

https://github.com/phalcon/cphalcon/issues/1925