    public static function country_name_by_code($code, $language="")
    {
        global $DB;

        $lang = core_get_language($language);

        $DB->query('SELECT name
					FROM nv_countries
		 			WHERE lang = '.protect($lang).'
					  AND country_code = '.protect($code));

        $row = $DB->first();

        return $row->name;
    }

The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.