MySqli查询已经影响行但不会显示结果

时间:2015-10-23 16:36:52

标签: php mysql

我已经使用基本SQL一段时间了,我遇到的任何问题都很简单。我不知道我是否遗漏了一些东西,但是我已经与我的mySQL服务器建立了正常的连接(num_rows = 1),但没有任何内容会通过mysqli_fetch_arrayfetch_assoc显示

$con = mysqli_connect("localhost", "***", "***", "***");
$result = mysqli_query($con,"SELECT * FROM support WHERE steamid = '".$steamprofile['***']."'");

while($row = mysqli_fetch_array($result)) {
   echo $row["email"];
}

1 个答案:

答案 0 :(得分:0)

您可以改变这样的代码。

$con = mysqli_connect("localhost", "***", "***", "***");
$result = mysqli_query($con,"SELECT * FROM support WHERE steamid = '".$steamprofile['***']."'");
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$row["email"];
}

我认为$row = mysqli_fetch_array($result)是错误。