php-mysql 问题笔记一——在命令行中可以执行的sql语句,无法从php页面页面执行!,php-mysqlsql
我的情况:
1.由于外键较多,插入数据时,提前关闭外键(SET FOREIGN_KEY_CHECKS=0)。
2.所使用的sql语句中,有外键绑定到其他表中,所以无法从php页面插入。
原因分析:
SET FOREIGN_KEY_CHECKS=0,此指令只对单一数据库用户有效,即使用该语句的用户有效,可以在忽略外键的情况下插入数据。
经验总结:
对于一些特殊操作,修改用户权限,应该及时回复正常状态,也就是说
SET FOREIGN_KEY_CHECKS=0;
sql语句
SET FOREIGN_KEY_CHECKS=1;*********************************这是很重要的********************************

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor