Reason analysis and solution of _php in PHP with self-increasing ID set example

Source: Internet
Author: User

The reason for the discontinuity of the ID setting in PHP is described as follows:

ALTER TABLE tablename drop column ID;
ALTER TABLE tablename Add ID mediumint (8) NOT null primary key auto_increment A;

Every time you delete it, add the two lines to the line.

And there's this.

Use the query () method in the Mysqli object to execute only one SQL command per call.

If you need to execute more than one SQL command at a time, you must use the Multi_query () method in the Mysqli object. The practice is to write multiple SQL commands in the same string as arguments passed to the Multi_query () method, separated by semicolons (;) between multiple SQL. This method returns true if the first SQL command does not make an error while executing, otherwise it returns false.

The above is a small series to introduce the ID set in PHP after the cause of the discontinuity and the solution, hope to be helpful to everyone, if you have any questions welcome to my message, small series will promptly reply to everyone, here also thank you for the cloud Habitat Community website support!

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.