Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Can';我不知道这个严格的标准有什么问题:只有变量应该通过引用传递_Php_Pdo_Warnings_Standards - Fatal编程技术网

Php Can';我不知道这个严格的标准有什么问题:只有变量应该通过引用传递

Php Can';我不知道这个严格的标准有什么问题:只有变量应该通过引用传递,php,pdo,warnings,standards,Php,Pdo,Warnings,Standards,在绑定以下函数中的值的行上出现错误: function update_vote_logs($accid, $site_id){ global $host_ip, $auth_db, $db_username, $db_password, $character_db, $world_db, $web_db; $con = connect($host_ip, $db_username, $db_password, $web_db); $exp = time() + (

在绑定以下函数中的值的行上出现错误:

    function update_vote_logs($accid, $site_id){
    global $host_ip, $auth_db, $db_username, $db_password, $character_db, $world_db, $web_db;
    $con = connect($host_ip, $db_username, $db_password, $web_db);
    $exp = time() + (43200);
    $sql = "REPLACE INTO `vote_logs` VALUES (?,?,?,?)";
    if (check_if_voted($accid, $site_id) == 0 || check_if_voted($accid, $site_id) == 2){
        if ($stmt = $con->prepare($sql)) {
            $stmt->bind_param("iiii", $accid, $site_id, time(), $exp);
            $stmt->execute();
            $stmt->store_result();
        }
    }
    $stmt->close();
    $con->close();
}
这是导致错误的行:

 $stmt->bind_param("iiii", $accid, $site_id, time(), $exp); 
我正在学习PHP,这是我第一次看到这个警告


有人能帮我吗?

我感觉时间()导致了这个问题,因为它不是一个变量,但我不能100%肯定你是对的<代码>$now=time()。。。绑定参数(“iiii”$accid$site\u id$now$exp)是的,就是这样:D谢谢:)这里没有
bind_参数
,而是有一个
bind_值
将在这里工作,因为您没有在循环中使用bind,这是您希望通过引用变量进行绑定的地方。mysqli没有bind_值@乔纳森·库恩