After the transaction is started, the Syntaxerror, unexpectedtokenIDENTIFIER (FOR), nearto & #039; error is returned when the query is based on the parameter & quot; for_update & quot; & amp; gt; true described in this document; UPDATE & #039; {code ...} phalcon version 1.3.4 verifies that your phalcon uses the row lock for_upade to report... after the transaction is started, follow the parameters described in the document
"for_update" => true
To query, an error is returned.
Syntax error, unexpected token IDENTIFIER(FOR), near to ' UPDATE'
$this->db->begin();$robots = Robots::find(array( "conditions" => "name LIKE %steve%", "order" => "name", "for_update" => true));...$this->db->commit();
Phalcon version 1.3.4
Verify that your phalcon will report an error when using the row lock for_upade? Or is my code incorrect?
Http://www.myleftstudio.com/reference/models.html#finding-records
Reply content:
After the transaction is started, follow the parameters described in the document"for_update" => true
To query, an error is returned.Syntax error, unexpected token IDENTIFIER(FOR), near to ' UPDATE'
$this->db->begin();$robots = Robots::find(array( "conditions" => "name LIKE %steve%", "order" => "name", "for_update" => true));...$this->db->commit();
Phalcon version 1.3.4
Verify that your phalcon will report an error when using the row lock for_upade? Or is my code incorrect?
Http://www.myleftstudio.com/reference/models.html#finding-records
Yes, phalcon 1.3.X has this problem. It should have been solved by phalcon 2.0.4 in December.
Solution: use the latest phalcon or use pdo to execute pure SQL