PHP mysqli_fetch_assoc在本地主机上运行,​​但在godaddy服务器上不运行

时间:2019-04-11 19:44:04

标签: php

我有这段代码可以在我的本地主机上运行,​​但不能在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)行上出现错误,但这在我的本地主机上有效。这是兼容性问题吗?

0 个答案:

没有答案