不知道为什么我会收到此 PHP 警告消息。似乎准备好的语句中有四个参数,bind_param() 中也有四个变量。谢谢你的帮助!
if($stmt = $mysqli -> prepare("SELECT url, month, year, cover_image FROM back_issues ORDER BY year DESC, month DESC")) {
$stmt -> bind_param("ssis", $url, $month, $year, $cover_image);
$stmt -> execute();
$stmt -> bind_result($url, $month, $year, $cover_image);
$stmt -> fetch();
while ($stmt->fetch()) {
echo "<li class='item'><a href='$url'><img src='$cover_image' alt='$cover_image' width='' height='' /></a><br /><span class='monthIssue'>$month $year</span></li>";
}
$stmt -> close();
$mysqli -> close();
}