使用PHP无法从数据库中获取正确的字段

I want to get rows in the database in which:

"l_area" is the table column

"in consignment" is the table

and the restriction "l_area" is equal to the stored value in "area" variable.

My code is shown below. It is only outputting all the selected items even if l_area is not equal to area.

    function get_all()
    {
        $area = $this->session->userdata('area'); 
        $this->db->select('l_area','d_area','description','dom','tom'); // the select statement
        $this->db->where('l_area' == $area);
        $q = $this->db->get('consignment'); // the table    
    }

Try this

public function get_all()
{
    $area = $this->session->userdata('area'); 
    $this->db->select('*'); // the select statement
    $this->db->where('l_area',$area);
    $query = $this->db->get('consignment'); // the table   
    $result = $query->result_array();

    print_r($result);
}