PMA\libraries\DisplayResults::_getFromForeign PHP Method

_getFromForeign() private method

Retrieves the associated foreign key info for a data cell
private _getFromForeign ( array $map, object $meta, string $where_comparison ) : string
$map array the list of relations
$meta object the meta-information about the field
$where_comparison string data for the where clause
return string formatted data
    private function _getFromForeign($map, $meta, $where_comparison)
    {
        $dispsql = 'SELECT ' . Util::backquote($map[$meta->name][2]) . ' FROM ' . Util::backquote($map[$meta->name][3]) . '.' . Util::backquote($map[$meta->name][0]) . ' WHERE ' . Util::backquote($map[$meta->name][1]) . $where_comparison;
        $dispresult = $GLOBALS['dbi']->tryQuery($dispsql, null, DatabaseInterface::QUERY_STORE);
        if ($dispresult && $GLOBALS['dbi']->numRows($dispresult) > 0) {
            list($dispval) = $GLOBALS['dbi']->fetchRow($dispresult, 0);
        } else {
            $dispval = __('Link not found!');
        }
        $GLOBALS['dbi']->freeResult($dispresult);
        return $dispval;
    }
DisplayResults