Possible Duplicate:
mysql_fetch_assoc error, can't seem to figure out what the problem is
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in警告:mysql_fetch_assoc()预计参数1是resourc
<?php
$Dblink = mysql_connect("localhost", "root", "","Amoozeshgah");
$res = mysql_query("select * from Tbl_About");
$rec = mysql_fetch_assoc($res);
?>
的查询工作,但有以下错误:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean
为什么呢?
可能重复,可以似乎找不出是什么问题](http://stackoverflow.com/q/2372029/),[警告:mysql_fetch_array():提供的参数不是一个有效的MySQL结果](http://stackoverflow.com/q/795746 /),或者当您提出问题并在“相关”部分中显示的其他几十人建议时H T。 – outis 2012-04-23 23:30:47
在返回值部分阅读http://php.net/manual/en/function.mysql-query.php – Neverever 2012-04-23 23:31:40
请勿使用['SELECT *'](http://stackoverflow.com/questions/321299/)除非您正在编写数据库管理程序;只选择你需要的列。 mysql扩展已过时,正在弃用。新代码应该使用mysqli或PDO,它们都具有重要的优点,例如支持预处理语句。 – outis 2012-04-23 23:32:53