public function matchingColumns($table1, $table2, $which_connection='')
    {
        if ($which_connection == '') {
            $which_connection=$this->default_db;
        }
        
        $definition1 = $this->tableDefinition($table1, $which_connection);
        $definition2 = $this->tableDefinition($table2, $which_connection);
        if (!is_array($definition1) || ! is_array($definition2)) {
            return array();
        }

        $matches = array_filter(array_keys($definition1),
            function ($col_name) use ($definition2) {
                return isset($definition2[$col_name]) ? true : false;
            }
        );

        return $matches;
    }
public function matchingColumns($table1, $table2, $which_connection='')
    {
        if ($which_connection == '') {
            $which_connection=$this->default_db;
        }
        
        $definition1 = $this->tableDefinition($table1, $which_connection);
        $definition2 = $this->tableDefinition($table2, $which_connection);
        if (!is_array($definition1) || ! is_array($definition2)) {
            return array();
        }

        $matches = array_filter(array_keys($definition1),
            function ($col_name) use ($definition2) {
                return isset($definition2[$col_name]) ? true : false;
            }
        );

        return $matches;
    }
public function matchingColumns ( $ table1 , $ table2 , $ which_connection = '' ) { if ( $ which_connection == '' ) { $ which_connection = $ this -> default_db ; } $ definition1 = $ this -> tableDefinition ( $ table1 , $ which_connection ) ; $ definition2 = $ this -> tableDefinition ( $ table2 , $ which_connection ) ; if ( ! is_array ( $ definition1 ) || ! is_array ( $ definition2 ) ) { return array ( ) ; } $ matches = array_filter ( array_keys ( $ definition1 ) , function ( $ col_name ) use ( $ definition2 ) { return isset ( $ definition2 [ $ col_name ] ) ? true : false ; } ) ; return $ matches ; }
Get column names common to both tables
@param $table1 [string] table name
@param $table2 [string] table name
$which_connection [optiona] see close()
@return [array] of [string] column names
Get column names common to both tables