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

for update

Hello guys,

in phalcon 1.3.3 is added for update functionality. But I getting this error:

Syntax error, unexpected token IDENTIFIER(FOR), near to ' UPDATE', when parsing: SELECT [InvoicePayment].* FROM [InvoicePayment] WHERE id = :id: AND [invoice_id] = ?0 FOR UPDATE (96)
#0 [internal function]: Phalcon\Mvc\Model\Query->parse() 
#1 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL) 
...

My code:

$regularPayment = $this->_getInvoice()->getInvoicePayment([
                        'id = :id:',
                        'bind' => [
                            'id' => $key
                        ],
                        'for_update' => true
                    ]);

Are you tried for_update in Phalcon 1.3.3 ? And how about shared_lock? Is it added too?



98.9k

It seems PHQL is not supporting that syntax, maybe it a further release it will be added.