catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

SELECT * on INNER JOIN - issue #805

Closed zerowebcorp closed 5 years ago

zerowebcorp commented 5 years ago

Hello,

I am trying to select ALL the columns from a table and join another table and select only 1 column.

$result = $this->db->select(
            'tblDomain',
            [
                '[><]tblAgent' => ['agentId' => 'id'],
            ],
            [
                'tblDomain.*',
                'tblAgent.country(agentCountryCode)',
            ],
            $where
        );
        print_r($this->db->last());

This works only if I change select individual tblDomain columns. I would like to select all columns, tblDomains.*

Output

SELECT tblDomain."",tblAgent.country AS agentCountryCode FROM tblDomain INNER JOIN tblAgent ON tblDomain.agentId = tblAgent.id WHERE isEnabled = 'Y' AND tenantId = '7da63ae0-f70b-11e8-983f-1231322cbdb6'

Is there any way to do this?

Information

catfan commented 5 years ago

Check the answer from #631.