大家帮忙看看我这是什么错误

WBOY
Release: 2016-06-23 13:56:45
Original
713 people have browsed it

$sql ="";比较长,在phpmyadmin成功执行并查出数据
$res = mysql_query($sql);//返回资源类型
放到代码中用mysql_fetch_assoc($res)在本地没错误
但是上传到服务器,mysql_fetch_assoc($res)就直接返回false
难道mysql_fetch_assoc()跟环境有关吗?


回复讨论(解决方案)

你的在服务器上var_dump($res);有结果集么?

你的在服务器上var_dump($res);有结果集么?


有结果集

这就奇怪了,
mysql_fetch_assoc() 函数从结果集中取得一行作为关联数组。返回根据从结果集取得的行生成的关联数组,如果没有更多行,则返回 false。
上面是此函数的定义,没有结果集的时候才会返回false。

这就奇怪了,
mysql_fetch_assoc() 函数从结果集中取得一行作为关联数组。返回根据从结果集取得的行生成的关联数组,如果没有更多行,则返回 false。
上面是此函数的定义,没有结果集的时候才会返回false。


数据库的问题,管理数据库的同同事删了数据,没通知我,我俩用的不是同一个库
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!