1

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..?

Codebrekers
  • 754
  • 1
  • 11
  • 29
  • maybe [1](http://stackoverflow.com/q/6950760) or [2](http://stackoverflow.com/a/14500710) or [3](http://tutorialsplane.com/codeigniter-join-table-alias/) idk I don't CI – Drew Jul 15 '16 at 12:24

0 Answers0