Home  >  Article  >  Backend Development  >  Reasons and solutions for the discontinuity of ID settings in PHP after they are incremented

Reasons and solutions for the discontinuity of ID settings in PHP after they are incremented

墨辰丷
墨辰丷Original
2018-06-01 15:11:161620browse

This article mainly introduces the analysis and solutions to the reasons for the discontinuity of ID settings in PHP after they are incremented. Friends in need can refer to the following

ID settings in PHP The analysis of the reasons for discontinuity after self-increment is as follows:

alter table tablename drop column id;
alter table tablename add id mediumint(8) not null primary key auto_increment first;

Add these two lines each time you delete them That’s it

There is also this

Using the query() method in the mysqli object can only execute one SQL command per call.

If you need to execute multiple SQL commands at one time, you must use the multi_query() method in the mysqli object. The specific method is to write multiple SQL commands in the same string and pass them as parameters to the multi_query() method, and use semicolons (;) to separate multiple SQL commands. If the first SQL command is executed without errors, this method will return TRUE, otherwise it will return FALSE.

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.

Related recommendations:

php Detailed introduction to operators and expressions

php js implements multi-point annotation on Baidu map

Detailed explanation of several ways of handling passwords in PHP

The above is the detailed content of Reasons and solutions for the discontinuity of ID settings in PHP after they are incremented. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn