我有这段代码可以在我的本地主机上运行,但不能在Godaddy服务器上运行
$sql = 'SELECT hash FROM user_for_activation where registeredDate = ?;';
$stmt = mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt,$sql)){
echo "SQL Connection Failed";
}
else{
mysqli_stmt_bind_param($stmt,"s",$dateRegistered);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
while($row = mysqli_fetch_assoc($result)){
$hash = $row['hash'];
}
}
在mysqli_fetch_assoc($result)
行上出现错误,但这在我的本地主机上有效。这是兼容性问题吗?