Php matters failed

Source: Internet
Author: User
Php transaction failed. PHPcode & lt ;? Php $ conn = mysql_connect ('localhost', 'root', '000000') ordie (& quot; 123123 !!! & Quot;); mysql_select_db ('eshop ', $ conn); mysql php transaction failed,
PHP code
  
  
  


The above code cannot be submitted due to sql2 error. But after I run it, I still inserted a piece of data? Sadly, why don't I perform rollback and delete the data? Puzzled.

------ Solution --------------------
Because the first transaction you write will not be rolled back.


To roll back the first entry

Start transaction;
Insert ..
Insert...
Commit;
------ Solution --------------------
Why is it difficult for you to know it.
------ Solution --------------------
Innodb supports transactions. myisam does not support transactions.
------ Solution --------------------
[Quote = reference:]

[Quote = reference:]

Why is it difficult for you to know it.
[/Quote]

Oh, my God, you said it was not difficult. you asked me how many people can visit the forum.

You can really blow.
[/Quote]

How many people can... If you say this, you are not afraid of losing face. let's look at the evolution of TAOBAO's public technical architecture, and see how people can split tables and databases and ensure that transactions can be done.


[Quote = reference:]

Reference:

Innodb supports transactions. myisam does not support transactions.

Good guy, positive solution. It seems that the latter has to be abandoned.
[/Quote]

In this case, the landlord is not afraid of ridicule.

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.