/    Sign up×
Community /Pin to ProfileBookmark

Plz help me

Hi

I have a table in database in that data is enterd different countrycode for same country
i wrote query for getting countrycode and country..it’s fine
but what happing is when i tried to call that query in to application,in application that coutry name is displaying twice based on countrycode
but
i don’t want to reapet the same country code in the dropdown
i want to display country name only once for different countrycode whose comes under same country

coutry_code country
12 xxxx
13 xxxx
14 xxxx
the data is like this

i am working in PHP
with mysql
can u plz suggest me for logic behind this

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@HuevoosApr 09.2008 — in your mysql query

GROUP BY country_code
Copy linkTweet thisAlerts:
@deepuauthorApr 10.2008 — Thanks

Group by condition is i know

but

i need the country names in dropdown based on countrycode

so i need to display all country name

see if table contains like this

country_code country

01 xxxx

02 xxxx

03 xxxx

i need to display country in dropdown for allcountry_code

i think it should be solved by PHP .plz respond as soon as possible
Copy linkTweet thisAlerts:
@deepuauthorApr 10.2008 — It is not working with sql query

again it is displayinglike above

i think we need to use some logic here
×

Success!

Help @deepu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...