Hi
Based on an IP address and country code that I fetch from a database, I want to show a corresponding country flag value for this country in a separate column?
To do this I have used CSS images:
select 'dbr.css', '.countryad {color: transparent; width: 25px; weight: 15px; background:url(user/flags_iso/24/ad.png) no-repeat; display:block; margin: 0 auto}';
select 'dbr.css', '.countrygb {color: transparent; width: 25px; weight: 15px; background:url(user/flags_iso/24/gb.png) no-repeat; display:block; margin: 0 auto}';
Then:
SELECT ip_address AS 'IP',
country_code as 'Country code',
if (country_code = 'ad','countryad','countrygb') as 'Flag'
FROM XXX_YYY
But this allows me to only handle 2 countries. How do I go about effectively checking each row country code and based on it, show the flag in a separate column? I could not find relevant sections in the guide.
Kind regards
Mindaugas