php-mysql Question Note 1 - SQL statements that can be executed on the command line cannot be executed from the php page! , php-mysqlsql_PHP tutorial

WBOY
Release: 2016-07-13 10:04:05
Original
706 people have browsed it

php-mysql Problem Note 1 - SQL statements that can be executed from the command line cannot be executed from the php page! , php-mysqlsql

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**** ******************************

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/966827.htmlTechArticlephp-mysql Question Note 1 - SQL statements that can be executed on the command line cannot be executed from the php page ! , php-mysqlsql My situation: 1. Because there are many foreign keys, when inserting data, mention...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!