My situation:
1. Since there are many foreign keys, when inserting data, close the foreign keys in advance (SET FOREIGN_KEY_CHECKS=0).
2. The sql statement used has foreign keys bound to other tables, so it cannot be inserted from the php page.
Cause analysis:
SET FOREIGN_KEY_CHECKS=0, this command is only valid for a single database user, that is, the user who uses this statement is valid, and data can be inserted while ignoring foreign keys.
Experience summary:
For some special operations, modifying user permissions should return to the normal state in time, that is to say
SET FOREIGN_KEY_CHECKS=0;
sql statement
SET FOREIGN_KEY_CHECKS=1;************************************This is very important**** ******************************