好的,我有一个名为 sendQuery 的函数,它可以发送您的查询。我知道如何使用 BindParams 来做到这一点,但我真的想不出一种方法来使它与执行中的绑定值一起工作。
这是代码:
    public function sendQuery($query, array $value, $do_fetch)
    {
        $query_process = $this->db->prepare($query);
        if(!$query_process->execute($binds))
        {
            throw new excpetion ("An error has occured!");
        }
        $this->insert = $this->db->lastInsertId();
        $this->row_count = $query_process->rowCount();
        if($fetch == true)
        {
            return $query_process->fetchAll();
        }
    }
如您所见,它使用 $binds 执行,
像 (WHERE user = ?) 一样工作,但我想发送这样的查询: (WHERE user = :user) 而不是 ' ? ',以及其中的多个。
我该怎么做?