Php mysqli_fetch_array()希望参数1是mysqli_结果,在

Php mysqli_fetch_array()希望参数1是mysqli_结果,在,php,mysql,Php,Mysql,我这里有个小问题。 我刚刚将EasyHPV13数据库导出到另一台计算机上的EasyHPV14 当我尝试运行我的php代码时,出现以下错误: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in 奇怪的是,它在旧电脑上工作,在新电脑上使用EasyHP V14,导入数据库和本地Web数据,我得到了错误。我将代码标记为/*error,用于我得到错误的行 我的php代码: <?php $con=m

我这里有个小问题。 我刚刚将EasyHPV13数据库导出到另一台计算机上的EasyHPV14

当我尝试运行我的php代码时,出现以下错误:

mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in 
奇怪的是,它在旧电脑上工作,在新电脑上使用EasyHP V14,导入数据库和本地Web数据,我得到了错误。我将代码标记为/*error,用于我得到错误的行

我的php代码:

<?php
$con=mysqli_connect("localhost","root","root","site_db"); /*error*/

if (mysqli_connect_errno())
{
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT * FROM produse where categorie='1'"); /*error*/

echo "

<table border='1'>
<tr>
<th ALIGN=center>Denumire</th>
<th>Specificatii</th>
<th>Pret</th>

</tr>";

while($row = mysqli_fetch_array($result)) /*error*/
  {
   echo "<tr>";
   echo "<td ALIGN=center>" . $row['denumire'] . "</td>";
   echo "<td ALIGN=center>" . $row['specificatii'] . "</td>";
   echo "<td ALIGN=center>" . $row['pret'] . "</td>";
   echo "</tr>";
  }
echo "</table>";

mysqli_close($con); /*error*/
?>

切换$con和查询


由于我看到它在连接时出现故障(根据您的错误评论),新数据库上的凭据是否相同?仍然是root/root?此外,我注意到您导出了数据库。。。您是否在服务器之间移动了所有内容?如。。。您的web服务器和DB服务器在同一个框中吗?旁注:我没有否决这个。最有可能的原因是,OP使用的是<代码> MySqLI**<代码>函数,而不是<代码> MySqL**<代码> ---考虑删除你的答案以恢复你的ReP点。