2
在调试过程中,我注意到脚本死于$stmt->fetch() or die($stmt->error);
行。 PHP日志中没有错误。它也不回应任何错误。你在代码中看到任何错误的东西吗?准备好的语句错误
$stmt = $db->prepare("SELECT e.msg_subject AS subject, e.msg_text AS text, u.fname AS firstname, u.lname AS lastname FROM emails AS e, users AS u WHERE e.msg_status=? AND e.msg_type=? AND u.id=?") or die($db->error);
$stmt->bind_param("isi", $status, $type, $userid) or die($stmt->error);
$stmt->execute() or die($stmt->error);
$stmt->bind_result($subject, $text, $firstname, $lastname) or die($stmt->error);
$stmt->fetch() or die($stmt->error);
$stmt->close();
我的mysql语法有什么问题吗? –
没有。我不认为。它将返回给定用户的所有消息,具有给定的状态和类型。 –
现在错误行'if($ stmt-> rowCount()> 0){'调用未定义的方法mysqli_stmt :: rowCount() –