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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
