Questions about concurrency in PHP

Source: Internet
Author: User
Questions about concurrency in PHP

Does MySQL have a mechanism to prevent concurrency that can be interpreted to listen to?

For example, the inventory is only 1, two users at the same time the purchase minus 1, will be negative.

But without PHP execution, let SQL do this operation A=a-1 ... where a>0 can be solved.

This knowledge is relatively scarce, do not know if there are predecessors of the post can be viewed, thank you



------Solution--------------------
http://ourmysql.com/archives/857
http://www.orczhou.com/index.php/2010/06/mysql-innodb-source-code-sync-1/
Http://www.cnblogs.com/perfectdesign/archive/2009/12/05/1617508.html
------Solution--------------------
MYSQL has concurrency mechanism to prevent access conflicts between different users

Let SQL do this operation A=a-1 ... where a>0 can prevent the existence of a negative stock
  • 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.