Practice project PDOException vid 26

Home Forums Bugs Practice project PDOException vid 26

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1393
    jurgenmuca
    Participant

    Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

    FIX:

    public function where($where, $values = array()){
    $this->query .= “where ” . $where;
    return $this->run($values);
    }

     

    add the appropriate where clause to the where function

    Note: This is how to use where clause

    $data = DB::table(‘users’)->select()->where(“id = :id”,[“id”=>2]);

     

     

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.