php有时候出错有时又好的

WBOY
Release: 2016-06-13 12:27:20
Original
1019 people have browsed it

php有时出错有时又好的


都不知道为什么?我感觉明明是对的啊?我给的明明是数组啊,怎么变布尔值了?
------解决思路----------------------
要自己看错误提示呢。
mysql_query()的返回值可能是resource,也可能是boolean,如果你不想看到这个错误提示的话就在while外面再加一层判断呢。
------解决思路----------------------
$query并没有得到句柄资源,而是得到了个布尔值(false)表明你的sql语句执行失败,请检查
------解决思路----------------------
$query = mysql_query($sql, $link) 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