I am using CI-bonfire, where I want to fetch data from multiple table and I want to give alias of table name but it'll give me error.
Bellow is my code example
$select = array(
$this->table_name .'.*',
'u.display_name as sender_user'
);
$join = array(
"users as u"=> array(
'condition' => 'u.id ='. $this->table_name . '.sender_user_id',
'type' => 'left'
)
);
$order = array(
"sortby"=>$this->table_name.".".$this->key,
"order"=>"DESC"
);
$config = array(
"req_data" => $req_data,
"select" => $select,
"join" => $join,
"order" =>$order
);
$this->grid->initialize($config);
When I am giving alias of USER table it'll give like bellow.
Unknown column 'bf_u.display_name' in 'field list'
In table display_name field is already available.
Any One have idea why it give me error or is their any other way to give alias of table in bonfire..?