Torakami wrote:
But now what i want to do is i want to display only those categories in dropdowns which are surely give me the data
It's not a big deal. Just load the data which matches the details table data.
For example, you have two tables Country & City.
------------------------------
Country
------------------------------
CountryID | CountryName
------------------------------
1 | US
2 | UK
3 | Canada
------------------------------
City
------------------------------
CountryID CityID | CityName
------------------------------
1 |1 | New york
1 |2 | Los Angles
2 |1 | London
2 |2 | Luton
------------------------------
Now you have to write a query to load Available Countries(for Dropdown) like below
SELECT B.CountryID,A.CountryName FROM Country A, City B
WHERE A.CountryID=B.CountryID
Now it'll load only Countries which has cities.
------------------------------
Available Countries
------------------------------
CountryID | CountryName
------------------------------
1 | US
2 | UK
------------------------------
That's it.