Php-mysql question Note 1-SQL statements that can be executed in the command line cannot be executed from the php page !, Php-mysqlsql. Php-mysql question Note 1-SQL statements that can be executed in the command line cannot be executed from the php page !, Php-mysqlsql: 1. due to the large number of foreign keys, when inserting data, take notes on php-mysql -- SQL statements that can be executed in the command line cannot be executed from the php page !, Php-mysqlsql
My situation:
1. because there are many foreign keys, SET FOREIGN_KEY_CHECKS = 0 when inserting data ).
2. the SQL statement used contains 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 using this statement is valid. you can insert data when the foreign key is ignored.
Experience Summary:
For some special operations, modify the user permissions, and the normal status should be promptly replied, that is
SET FOREIGN_KEY_CHECKS = 0;
SQL statement
SET FOREIGN_KEY_CHECKS = 1; * ******************************** this is very important *** *****************************
Http://www.bkjia.com/PHPjc/966827.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/966827.htmlTechArticlephp-mysql problem Note 1-SQL statements that can be executed in the command line, cannot be executed from the php page !, Php-mysqlsql: 1. when inserting data due to a large number of foreign keys...