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.

[bug] PHQL Update Query Always Return True

        $phql = "UPDATE Category SET title='xxx' WHERE id=999";

        $result = $this->modelsManager->executeQuery($phql);

        var_dump($result->success()); // true

The row where id=999 is not existed, but update result is always true.



19.3k
Accepted
answer

hi @jacky I don't know if is it a bug because the query is "well formed", I think what you're needing is use \Phalcon\Di::getDefault()->getShared('db')->getReadConnection()->affectedRows() example

Good luck

thank you very much

hi @jacky I don't know if is it a bug because the query is "well formed", I think what you're needing is use \Phalcon\Di::getDefault()->getShared('db')->getReadConnection()->affectedRows() example

Good luck