当前位置: 代码迷 >> PHP >> mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:何解?解决办法
  详细解决方案

mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:何解?解决办法

热度:1128   发布时间:2012-05-21 18:04:41.0
mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:何解?
mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\4.php on line 12

请问是什么错误?如何改正?谢谢大家啊~

代码如下:

<?php
$con = mysql_connect("localhost","root ","");
//通过服务器locahost建立连接,用户名为root,无密码

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }//如果不成功,显示错误
mysql_select_db("crms", $con);//选择数据库
$result = mysql_query("SELECT * FROM Cno");//查找

while($row = mysql_fetch_array($result))//打印
  {
  echo $row['Cno'] . " " . $row['Cno'];
  echo "<br />";
  }

mysql_close($con);
?>

------解决方案--------------------
探讨

Access denied for user ''@'localhost' to database 'crms'

这样的错误该怎么改呢?
  相关解决方案