From: http://www.gosoa.com.cn/php-mysql%E4%BA%8B%E5%8A%A1%E8%AF%A6%E8%A7%A3
Before talking about PhP MySQL transactions, You can first understand the differences between PHP MySQL and mysqli.
First, both functions are used to process
There are two main methods to process MYSQL transactions.
1. Use begin, rollback, and commit to implement
Start a transaction
Rollback transaction rollback
Commit transaction validation
2. directly use set to change the mysql automatic submission
Several steps of MySQL transaction processing:1. Turn off automatic submission2. Open transaction Processing3. The exception will automatically throw the exception prompt and roll back4. Turn on automatic submission
Note: MySQL has only this innodb
A transaction is a mechanism that ensures that multiple SQL statements are treated as a single unit of work. Transactions have the following effects: Consistency: Simultaneous queries and updates do not conflict with each other, and other users do
MySQL transaction is mainly used to deal with large-scale and high-complexity data. For example, in a banking system, to add an account, you need to add a basic account information, but also to add information related to the account, such as phone
Pessimistic lock and optimistic lock:Pessimistic lock: As the name implies, is very pessimistic, every time to take the data when they think others will change, so every time when the data are locked, so that others want to take this data will block
Tag: is set ODB full ROM wait ima margin fallbackI. When to use a table lockFor InnoDB tables, row locks should be used in most cases. In individual special transactions, you might consider using table locks (recommended).1. Transactions need to
MySQL autocommit (auto-commit) is on by default, it has a certain impact on MySQL performance, for example, if you insert 1000 data, MySQL will commit1000 times, if we put autocommit off, through the program to control , only one commit is allowed.1,
Turn InnoDB row-level locksInnoDB Row-level locksCategory: Database 2013-03-13 16:40 1745 people read comments (0) favorite reports Nnodb lock mode and lock methodInnoDB implements the following two types of row locks.? Shared Lock (S): Allows a
Things, plainly, is to bind multiple SQL statements together, if one of them can not be executed on all of these SQL termination, the typical use of it is involved in Money transfer operations;INODB,BDB and NDB to support thingsMyISAM not
PHPmysql and mysqli transaction instructions are shared. Mysqli encapsulates some advanced operations, such as transactions, and many available methods in the database operation process. A lot of applications are mysqli transactions. For example,
MYSQL design optimization and mysql Design
This article describes how to optimize mysql from various aspects.1. Optimize SQL statements (1) locate the SQL statements to be optimized (1) count the frequency of SQL statements using show
MySQL Study Notes _ 10_MySQL Advanced Operations (below) and study notes _ 10_mysql MySQL Advanced Operations (below)
V. MySQL pre-processing statements
1. Set the pre-processing stmt and pass a data as the where judgment condition.
Prepare stmt
1. Why do I need to use transactions?A transaction is a single unit of work. If a transaction succeeds, all data modifications made in the transaction are committed,Become a permanent component of the database. If the transaction encounters an error
Database Tuning tutorial (2) Prepare slow query data and optimize Databases
1. Slow query found
In the previous section, we talked about the definition of slow queries. This section describes how to create a large table and prepare data for slow
Test your understanding of MySQL transactions and isolation levels.
I have written an article titled MySQL InnoDB Transaction isolation level and dirty read, Repeatable read, phantom
-- General steps to optimize SQL -- 1. Learn the execution frequency of various SQL statements through show status and application features/* provide server status information through show status, you can also use the mysqladmin extended-STATUS
First, mysqli connections are permanent connections, while mysql does not. What does it mean? Mysql will re-open a new process whenever it is used for the second time, while mysql uses only the same process, in this way, the pressure on the server
MySQL transaction processing and application analysis transaction processing are widely used in various management systems. for example, in the personnel management system, many database synchronization operations require transaction processing. For
MySQL study note _ 10_MySQL Advanced Operations (below) MySQL Advanced Operations (below)
V. MySQL pre-processing statements
1. Set the pre-processing stmt and pass a data as the where judgment condition.
Prepare stmt from "select * from
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.