更新:
我在 mysqli 中有几个需要帮助的错误和警告:
Fatal error: Call to undefined method mysqli_stmt::get_result() in ... on line 63
在我下面的代码中,有人知道如何处理这些警告和错误吗?
$query = "SELECT * FROM Teacher WHERE TeacherAlias = ?";
// prepare query
$stmt=$mysqli->prepare($query);
// You only need to call bind_param once
$stmt->bind_param("s",$getid);
// execute query
$stmt->execute();
//get results
$result = $stmt->get_result();
$numrows = mysqli_num_rows($result);
if ($numrows == 0){
// don't use $mysqli->prepare here
$query = "SELECT * FROM Teacher WHERE TeacherUsername = ?";
// prepare query
$stmt=$mysqli->prepare($query);
// You only need to call bind_param once
$stmt->bind_param("s",$getuser);
// execute query
$stmt->execute();
}