<分区>
我需要我的 php 来打印出包含所有天气预报以及人员姓名和电子邮件的 HTML 表格。 它给了我一个错误 警告:mysqli_stmt::bind_result():绑定(bind)变量数与准备语句中的字段数不匹配
这是我的代码
$query = "SELECT weather.report,
cities.name, cities.email FROM weather INNER JOIN cities ON weather.city=cities.city ";
$stmt = $mysqli->stmt_init();
if ($stmt->prepare($query)) {
//$stmt->bind_param("s", $player);
$stmt->execute();
$stmt->bind_result($tempCity, $tempReport, $tempName, $tempEmail);
echo "<table width=500 border=1 cellpadding=5>
<tr><th>Temperature</th><th>Report</th><th>City</th><th>DATE</th></tr>";
while ($stmt->fetch()) {
echo "<tr>
<td>".$tempCity."</td>
<td>".$tempReport."</td>
<td>".$tempName."</td>
<td>".$tempEmail."</td>
</tr>\n";
}
echo "</table>";
$stmt->close();
} else {
$error = "Sorry could not retrieve information"; echo $error; return;
}
$mysqli->close();
谢谢你的帮助