Heim > Artikel > Backend-Entwicklung > 和mysql_fetch_array()结上的不解之缘.
和mysql_fetch_array()结下的不解之缘.....
Warning: mysql_fetch_array() expects parameter 2 to be long, resource given in www/view.php on line 106
能取出数据,就是报警告而已
确认数据库的连接正常
line 106 就是 $result4=mysql_fetch_array($commentquery,$mylink);
然后我把$mylink去掉了之后..就不报警告了...弄了一个下午也没找出个答案来..求解释
贴出部分代码
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?php $comment="select * from comment where id_dian='$ID'"; $commentquery=mysql_query($comment,$mylink); $result4=mysql_fetch_array($commentquery,$mylink); if($result4=mysql_fetch_array($commentquery)) { $i=1; do{ echo $i."楼--".$result4['username'].": ".$result4['comment']."</br>"; $i++; } while($result4=mysql_fetch_array($commentquery)); } else { echo "暂无评论,我们期待你的参与"; } ?>