PMA\libraries\DisplayResults::_getUnsortedSqlAndSortByKeyDropDown PHP Method

_getUnsortedSqlAndSortByKeyDropDown() private method

Prepare unsorted sql query and sort by key drop down
See also: _getTableHeaders()
private _getUnsortedSqlAndSortByKeyDropDown ( array $analyzed_sql_results, string $sort_expression ) : array
$analyzed_sql_results array analyzed sql results
$sort_expression string sort expression
return array two element array - $unsorted_sql_query, $drop_down_html
    private function _getUnsortedSqlAndSortByKeyDropDown($analyzed_sql_results, $sort_expression)
    {
        $drop_down_html = '';
        $unsorted_sql_query = Query::replaceClause($analyzed_sql_results['statement'], $analyzed_sql_results['parser']->list, 'ORDER BY', '');
        // Data is sorted by indexes only if it there is only one table.
        if ($this->_isSelect($analyzed_sql_results)) {
            // grab indexes data:
            $indexes = Index::getFromTable($this->__get('table'), $this->__get('db'));
            // do we have any index?
            if (!empty($indexes)) {
                $drop_down_html = $this->_getSortByKeyDropDown($indexes, $sort_expression, $unsorted_sql_query);
            }
        }
        return array($unsorted_sql_query, $drop_down_html);
    }
DisplayResults