PHP施行sql语句失败,但同样的语句在MYSQL中可以执行

WBOY
Release: 2016-06-13 12:59:40
Original
996 people have browsed it

PHP执行sql语句失败,但同样的语句在MYSQL中可以执行
现在的问题是在同一个数据库中有些表能够查询,有些表查询不了。但是这些语句在mysql中都能正常执行
------解决方案--------------------
一个情况一个情况地检查,LZ可以在PHP那边 组合成SQL语句之后 输出生成的sql语句看看 看看数据在后台是否正常 编码有没问题  再检查下数据库的编码
------解决方案--------------------
同样的sql语句直接在数据库中可以插入?
看下你PHP那边写的SQL语句
------解决方案--------------------
直接echo 一下,看看到底输出的是什么。
------解决方案--------------------
权限没问题,就肯定是你的sql有问题了。
把最终要执行的sql打印出来
------解决方案--------------------
mysql_query($sql) or die(mysql_error());

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!