Why does Phalcon use the row lock for_upade to report an error?

Source: Internet
Author: User
Tags token identifier
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" => trueTo 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" => trueTo 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.